alternative to performclick to do things in background

558fe5180e0e8fc922d31c23ef84d240

Hi, I'm searching for a way that let run a event without need, that specific form to be open, and also save thing.
I explain better, the performclick will only fire if that specific form it's open, I'm searching a way to do this on background.
This is the code of where performclick will fire (thanks to a timer)

 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Try
            Dim value As Integer = maxVal
            If Not IsNumeric(Label10.Text) Then
                Label10.Text = maxVal.ToString
            End If
            Integer.TryParse(Label10.Text, value)
            If value >= 1 And value <= maxVal Then
                value -= 1
                Label10.Text = value.ToString
            Else
                If value <= 0 Then
                    Form11.Button5.PerformClick()
                    Timer1.Stop()
                    Label10.Text = maxVal.ToString
                End If
            End If
        Catch ex As Exception

        End Try
    End Sub

This is the form11's button_5 code

  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

Checking if in current combobox index (for next loop) a number is >=1 <= 10

558fe5180e0e8fc922d31c23ef84d240

Hi, I like to ask for a clarification about it. I have combobox.items(i) that go trough a for next loop for each index I need to check if its content (number) will be >=1 or <=10. Now I tried this one, but I know where the error might be, the + " Days" combination that it's a string and when checking in the if statement the text it give me an error of course. It's there any tip to check only a number in a integer + string combination on an if?
In case I can delete the + " days" and put it in an label so the combobox will be filled only with the integer part, and the if can work (if I'm right)
This is the part of code

   ComboBox3.Items(i) = (365 - dysdiff).ToString + " Days"
            If ComboBox3.Text.ToString >= 1 <= 10 & " Days" Then
                MsgBox("post old", MessageBoxButtons.OK)
            Else
            End If
        Next

Timer tick doesn’t fire another form button click event

558fe5180e0e8fc922d31c23ef84d240

Hi, like title, I have a timer, that when reach 0 will fire event on another form, then timer restart but when reach 0 nothing happen. how can I achieve this?

 Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        Dim value = CInt(Label10.Text)
        If value >= 1 And value <= 30 Then
            value -= 1.ToString
        Else
            If value >= 0 Then
                Form11.Button5_Click(sender, e)
                Timer1.Stop()
            End If
        End If
    End Sub

Update previously stored list of datetimes in a combobox, in a cycle for

558fe5180e0e8fc922d31c23ef84d240

Hi, how can I make sure that all the datetime stored previously by user input will be updated in a cycle for?
I explain better the structure
Combobox2 <----- is where list of datatime are previously stored
Combobox3 <------- is where remaining time is given by a substraction of two dates, stored in days remaing.
The fact, is now that these values are only stored and doesn't change with time passing by.
This is my code

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click

        For i = 0 To ListBox1.Items.Count
            Dim d As DateTime = DateTime.Now
            Dim d2 As DateTime = ComboBox2.SelectedItem(i)
            Dim dysdiff As String = (d - d2).Days.ToString()
            ComboBox3.SelectedItem(i) = 365 - dysdiff & " Days"
        Next
    End Sub

Clean all my settings VB.NET

558fe5180e0e8fc922d31c23ef84d240

Hi, how can I clean all saved settings in my.settings ? Do I need only to put
my.settings.[name].clear() or a My.settings.reset() can do a good job for all the user setting added into the program?
Also how can I add an exception if there is nothing in that setting or all settings? Can I put like
the isnullorempthy and referring it to that particular setting?

If ask = Msgboxresult.Yes then
my.settings.[name1].clear()
my.Settings.reset()
if ask = msgboxresult.no then
end if

countdown with 3 label, (hh:mm:ss) when reach 1 minute timer freeze

558fe5180e0e8fc922d31c23ef84d240

Hi, I have a issues, in this code I have a countdown with function declared, the issues now is that, if starting the time with only seconds timer go well but if the timer go to one minute if button is clicked timer suddently stop. Is there anything wrong with the code?

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        If Label5.Text = 0 AndAlso Label8.Text = 0 AndAlso Label7.Text < 59 Then
            Label7.Text = Label7.Text - 1.ToString
            If Label5.Text = 0 AndAlso Label8.Text = 0 AndAlso Label7.Text = 0 Then
                Timer1.Stop()
                MsgBox("timer out", MessageBoxButtons.OK)
            End If
            If Label7.Text = 0 AndAlso Label8.Text > 1 Then
                Label8.Text = Label8.Text - 1.ToString
                Label7.Text = 59
            ElseIf Label5.Text >= 0 AndAlso Label8.Text >= 0 AndAlso Label7.Text = 59 Then
                Label7.Text = 59
                Label8.Text = 59
                Label7.Text = Label7.Text - 1.ToString
                Label8.Text = Label8.Text - 1.ToString
                Label5.Text = Label5.Text - 1.ToString
            End If
        End If
    End Sub

for next loop doesn’t count last line on a textbox

558fe5180e0e8fc922d31c23ef84d240

Like title, more particulary, I have two textbox when user put links when finished the result will be on the second one with some default string in the 0 index of the counter and after the exiting of the loop. My question is how I can make that even the last line will be readed in the for loop? Because I was thinking that the problem will be in the temparray=textbox1.Lines

 tempArray = TextBox1.Lines
        For counter = 0 To tempArray.Length - 1
            If counter = 0 Then
                tempArray(0) = cbname2
            ElseIf counter = 1 Then
                tempArray(1) = "~!" & "img(" & tempArray(counter) & ")"
            ElseIf counter >= 2 Then
                tempArray(counter) = "img(" & tempArray(counter) & ")"
            End If
            TextBox2.Lines = tempArray
        Next
        TextBox2.Text &= vbCrLf & "!~" & " ~~~"
    End Sub

sub of a event handler (dynamically generated, combobox, textbox, button)

558fe5180e0e8fc922d31c23ef84d240

Hi all, I have created an Event handler to a function for clicking a generated button, now when this button is clicked need to paste in a textbox the Combobox.seleteditem (that it's a string. Each generated one (Combobox, textbox, button) will have a selected index of the Combobox that it's different, but that is not the problem because I put it in an if, the issues it's that I can't put inside this sub all the three-component. After all, it tells me that the windows form button cannot be a textbox, etc. Do I need to put another two event handlers for textbox and Combobox? (The code below it's a workaround, but I Like to do this with a button)

Public Sub btn_Click(sender As System.Object, ByVal e As System.EventArgs)
        'Dim btn As New Button
        'btn = CType(sender, Button)
        'Dim txt As New TextBox
        'txt = CType(sender, TextBox)
        Dim cbx As New ComboBox
        cbx = CType(sender, ComboBox)
        TextBox4.Text += cbx.SelectedItem.ToString & vbCrLf
    End Sub

get combined textbox text into a new one in sorted checkedbox order

558fe5180e0e8fc922d31c23ef84d240

Hi, I have a question, how can I achieve this, like I have declared 3 variable as string, each checkbox has a variable that will be created if clicked also when checked it will put the corresponding textbox.text into it. Now the problem is I need to make sure that the first one that will be selected will be the first one that will be paste thanks to the variable, the seond checked and third checked same thing. This is the code

 Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
        Dim fntext As String
        Dim artext As String
        Dim dltext As String
        If CheckBox3.Checked = True Then
            fntext = TextBox1.Text
        ElseIf CheckBox4.Checked Then
            artext = TextBox4.Text
        ElseIf CheckBox5.Checked Then
            dltext = TextBox6.Text
        End If
    End Sub
    TextBox7.Text += fntext & vbCrLf & artext & vbCrLf & dltext
End Class

vb net reload filterbox from list saved from settings

558fe5180e0e8fc922d31c23ef84d240

Hi, I have a issues, I have to load again the listbox, after filtering trought a textbox if a string is the same. I tried this code, but doesn't work at the is null or empthy, how can I reload it by a cicle for?

 Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs) Handles TextBox3.TextChanged
        Dim items = From it In ListBox1.Items.Cast(Of Object)()
                    Where it.ToString().IndexOf(TextBox3.Text, StringComparison.CurrentCultureIgnoreCase) >= 0
        Dim matchingItemList As List(Of Object) = items.ToList()
        ListBox1.BeginUpdate()
        ListBox1.Items.Clear()
        For Each item In matchingItemList
            ListBox1.Items.Add(item)
        Next
        If String.IsNullOrEmpty(TextBox3.Text) Then
            ListBox1.Items.AddRange(My.Settings.userlist.ToString)
        End If
        ListBox1.EndUpdate()
    End Sub

Visual studio – Add static string to text in a cycle

558fe5180e0e8fc922d31c23ef84d240

Hi, all I've a question, i have a series of links and need to put it in a specific point of a static string, that will need to stay with every cycle and don't want to lose it I make this one till now:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        For Each line As String In TextBox1.Lines
            TextBox2.Text = "[link ]" & "(" & TextBox1.Text & ")" & vbCrLf
        Next
    End Sub
End Class

The problem I'm encounting it's when i put text in the first one textbox (That I use as input for after convert with a button and on the other one textbox2 will give me the result) for ex:
Textbox1 text
https first link
http second link
but the result will be that, only the first line, link will be correctly inserted inside of it. How can I fix it, keeping that string also for others too, because there are a lot of it, and also it's possible to make sure that if I'll put ex:
google - https first link
yahoo - http second link
The program find by itself the link part and add this static string ? ex:
google - (link ) (https first link)
yahoo - (link) (https second link)
Thank you in advice.