Member Avatar for Micheal87

Hi, I try to show up a notification when an if statement is true, but it doesn't show up
also I checked the win 11 notification is something was on, but all things is off.
In case I can only create a custom one.

S.O = Win 11
Version of Visual Studio = 2022

Also I created a new project for testing this with a simple button click first doesn't work then I tried with adding an icon on notification and was working, at that point I tried to add an icon also there, but not showed up.
Also this is the code where notifyicon is
I tried also with notifyicon1.visible = true

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Try
            For i As Integer = 0 To ComboBox3.Items.Count - 1
                ComboBox2.SelectedIndex = i
                Dim d As DateTime = DateTime.Now
                Dim parsedate As DateTime = ComboBox2.Items(i).ToString
                Dim d2 As DateTime = DateTime.ParseExact(parsedate, "dd/MM/yyyy HH:mm:ss", System.Globalization.CultureInfo.CurrentCulture)
                Dim ts As New TimeSpan((d - d2).Ticks)
                Dim dysdiff As Integer = ts.TotalDays
                Dim cbNum As Integer = 365 - dysdiff
                ComboBox3.Items(i) = cbNum.ToString
                Dim lstname As String
                lstname = ListBox1.Items(i).ToString()
                If cbNum <= 10 AndAlso cbNum >= 1 Then
                    NotifyIcon1.ShowBalloonTip(3000, "test", lstname & " have " & cbNum & " days left before will get delete", ToolTipIcon.None)
                End If
            Next
        Catch ex As Exception

        End Try
    End Sub
Member Avatar for Micheal87

Guys, it resolved by herself, I closed and re open again the application... I don't know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.