codeorder 197 Nearly a Posting Virtuoso
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ProgressBar1
            .Maximum = 100
        End With
        With Timer1
            .Interval = 500 '// 1/2 sec. delay.
            Me.Show() '// display Form before starting Timer.
            .Start() '// start Timer.
        End With
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static iCount As Integer = 0
        If Not iCount = 10 Then
            iCount += 1
            ProgressBar1.Value += 10
        Else
            frmLogin.Show()
            Me.Close() '// stops the Timer as well.
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Do let me know how it goes and if you have any further questions, you know what to do.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Imports System.IO
Public Class Form1
    Private myFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\The HONG KONG Test.txt" '// your file.
    Private arX() As String = Nothing '// String Array to real File into.
    Private sFileContent As String = Nothing '// String to rewrite content back to file with.
    Private xnL As String = vbNewLine '// shortcut for vbNewLine. :D
    Private sCity As String = "HONG KONG"
    '// your 2 Strings to add to file if sCity located.
    Private s1 As String = sCity & " KAI TAK       VHHX31 10930316 22.305500 114.214500109.9031600015"
    Private s2 As String = sCity & " KAI TAK       VHHX13 10930136 22.321667 114.196667111.9008800015"
    Private isFileEdited As Boolean '// determine if worth saving or not.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If File.Exists(myFile) Then '// check if file exists.
            arX = File.ReadAllLines(myFile, System.Text.Encoding.Default) '// load file lines into Arrays.
            isFileEdited = False '// set to False and only save if True.
            For i As Integer = 0 To arX.Length - 1 '// loop thru Arrays.
                If Not sFileContent = "" Then sFileContent &= xnL & arX(i) Else sFileContent = arX(i) '// store line content.
                If arX(i).StartsWith(sCity) Then '// check if current line .StartsWith...
                    If Not i = arX.Length - 1 Then '// if not last line of file.
                        '// check if not next line .StartsWith..., Then...
                        If Not arX(i + 1).StartsWith(sCity) Then sFileContent &= xnL & s1 & xnL & s2
                    Else '// add to end of file.
                        sFileContent …
codeorder 197 Nearly a Posting Virtuoso

Post your "imitating" Form's code.

codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso
If i > 10 Then
            Nextform.Show()
            Timer1.Stop()
            Me.Close '// Close current Form.
        End If
codeorder 197 Nearly a Posting Virtuoso

You more than likely have to login into PayPal, navigate to the proper page, then extract data if the page has the balance on it.
.This can easily be done with a WebBrowser.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim x As String = "some message"
        MsgBox(x) '// original String.
        x = StrReverse(x)
        MsgBox(x) '// reversed String.
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Button

Imports Microsoft.Win32
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each arg As String In My.Application.CommandLineArgs
            MsgBox(arg) '// get full path of file.
            '// do what you want with file afterward.
        Next
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With My.Computer.Registry.ClassesRoot
            .CreateSubKey(".myCoolFileExtension").SetValue("", "myCoolFileExtension", RegistryValueKind.String)
            .CreateSubKey("myCoolFileExtension\shell\open\command").SetValue("", Application.ExecutablePath & " ""%l"" ", RegistryValueKind.String)
        End With
        MsgBox("Done." & vbNewLine & "Double click any file on your p.c. with the "".myCoolFileExtension"" as a file extension, to have it load in your app. by default.", MsgBoxStyle.Information)
    End Sub
End Class

Registry code boosted from here: http://www.codeproject.com/KB/vb/VBFileAssociation.aspx

I have not bothered coding in the Registry, until now:D, although I do have a feeling that the ""%l"" in the above code should actually be a "1", not a .LowerCase "L".

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.Alt AndAlso e.KeyCode = Keys.C Then MsgBox("tada")
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.KeyPreview = True '// keep focus of Keys on Form.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Post your code, easier to figure out why you're getting an error.

codeorder 197 Nearly a Posting Virtuoso

q.q.(quick question)
Do you only need to kill.processes if your app. is active or can it run in the background and kill.processes if certain keys are pressed?

codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso

Why not use a TabControl and remove the TabHeaders on Form.Load?

codeorder 197 Nearly a Posting Virtuoso

You will also need to have your app. know what to do with the file once it is assigned to load it.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each arg As String In My.Application.CommandLineArgs
            MsgBox(arg) '// get full path of file.
            '// do what you want with file afterward.
        Next
    End Sub
End Class

To test this quickly, build your app., create a file with any type of file.extension, right click the file and select "Open" or "Open With".
Locate your recently build app. and select it. A MsgBox should appear with the file's full path. Afterward, that assigned file extension, if selected to always use that program to load it, should have your app.'s icon on it and double clicking it should automatically load it in your app..

Hope this helps.

codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso

>>...play a sound that is in your Resource folder
http://www.daniweb.com/software-development/vbnet/threads/46514

codeorder 197 Nearly a Posting Virtuoso

Glad I could help. :)

codeorder 197 Nearly a Posting Virtuoso

I just finished putting this together. Hope it helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        replaceText(TextBox1)
    End Sub

    Private Sub replaceText(ByVal myCoolTextBoxToReplaceIn As TextBox)
        Dim iSi As Integer, sTemp As String
        With myCoolTextBoxToReplaceIn
            Do Until iSi >= .TextLength
                If .Text.Substring(iSi).Contains("|") Then
                    iSi = .Text.IndexOf("|", iSi)
                    sTemp = .Text.Substring(iSi - 3, 7)
                    .Text = .Text.Replace(sTemp, "***|***")
                    MsgBox(sTemp) '// get value.
                End If
                iSi += 1
            Loop
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

(jingda, there is nothing to benefit by punishing)

If I live for death, destruction, and corruption, does that make me sane in an insane world?

Investigate

codeorder 197 Nearly a Posting Virtuoso

Works here just fine.
Try explaining the issue and not just saying sh.t don't work.

Just wondering, is it changing all #'s in the entire TextBox and you only need to change the #'s on the lines that .Contains("|")?
AndAlso, change only the first 3 #'s before the "|" and the 3 #'s after?

Hope this helps to solve your issue, although it should have been info provided by you already.

p.s. Welcome to an "IT" forum.:)

codeorder 197 Nearly a Posting Virtuoso

Use the _TextChanged event of the ComboBox instead of a Timer.

Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
        '// search code here to populate items.
    End Sub

>>...one would be to display the first and last name in the combo-box if this is possible...
When searching and getting values from db, add ALL values from the item to an ArrayList and only add the First/Last name to ComboBox.

On cmb_SelectedIndexChanged, get values from ArrayList by using the ComboBox.SelectedIndex.

Private arlDBitems As New ArrayList

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        With ComboBox1
            If Not .SelectedIndex = -1 Then
                MsgBox(arlDBitems(.SelectedIndex))
            End If
        End With
    End Sub

    Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
        '// .Clear ArrayList and ComboBox items here.
        '// search code here to populate items to ComboBox with First/Last name only and all other info to the ArrayList.
    End Sub

Hope this helps.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        setPanelVisibility(Panel2, Panel1, Panel3)
    End Sub
    Private Sub setPanelVisibility(ByVal visiblePanel As Panel, ByVal notVisiblePanel1 As Panel, ByVal notVisiblePanel2 As Panel)
        visiblePanel.Visible = True
        notVisiblePanel1.Visible = False
        notVisiblePanel2.Visible = False
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With TextBox1
            .Text = "123|456" '// FOR TESTING.
            For Each c As Char In .Text '// loop thru all char.s.
                If Char.IsDigit(c) Then .Text = .Text.Replace(c, "*") '// .Replace char. with your char..
            Next
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Synthax for a method:

Sub Methodname
'
' Place your method here
'
End Sub

...

lolafuertes, in your previous post, you mentioned "Sub Methodname".
Being a hobbyist programmer, I really have no use to learn all those fancy words, I just learn what I need to learn. Since I just recently somewhat got a clearer understanding of what a "Method" is(reading a reply by adatapost), your post threw me off.

I always thought a Sub was a "Sub" and a Function was a "Function", and of course, just somewhat learned that "Method" was everything following the dot.
Example: Me.Text = "test" .Text being the Method.

If no problem for either you or anyone else, do clarify this; and no, not busting chops, just trying to move on to the next thing without confusion.
Thanx.

codeorder 197 Nearly a Posting Virtuoso

Was a.f.f.(away.from.forum:D).
As for a component to do this, I have no clue if there is one or where to find one online.

To get started on something similar to that time slot view, I would use a ListView with columns.
After you get a sense of how all should work, try to create your own Custom ListView and modify it as needed.

Other than that, good luck.

codeorder 197 Nearly a Posting Virtuoso

civosi1028, next time create your own thread.

Otherwise, see if this helps.
Add 1 Timer, 1 Label, and 1 Button from the Toolbox.

Public Class Form1
    Private myCoolHours, myCoolMinutes, myCoolSeconds As Integer

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If myCoolMinutes = 15 Then
            Timer1.Stop()
            MsgBox("tada")
            Exit Sub
        End If
        If myCoolSeconds = 60 Then
            myCoolSeconds = -1
            myCoolMinutes += 1
        End If
        myCoolSeconds += 1
        Label1.Text = CInt(myCoolHours).ToString("00") & ":" & CInt(myCoolMinutes).ToString("00") & ":" & CInt(myCoolSeconds).ToString("00")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With Timer1
            .Enabled = Not .Enabled '// toggle On/Off.
        End With
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 1000 '// 1 second delay.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sTemp As String = "1,2,3,4,5"
        Dim iIndex As Integer = getIndex(sTemp, ","c, 3)
        With sTemp
            MsgBox(.Substring(0, iIndex))
            MsgBox(.Substring(iIndex + 1))
        End With
    End Sub

    Private Function getIndex(ByVal myString As String, ByVal mySeparator As Char, ByVal myNumberOfIndexes As Integer) As Integer
        Dim iTemp As Integer = myString.IndexOf(mySeparator)
        For i As Integer = 1 To myNumberOfIndexes - 1
            iTemp = myString.IndexOf(mySeparator, iTemp + 1)
        Next
        Return iTemp
    End Function
End Class
codeorder 197 Nearly a Posting Virtuoso

And which part of that image/app do you have problems with?

codeorder 197 Nearly a Posting Virtuoso

Still Forbidden here.
Try attaching the image to your next post.

codeorder 197 Nearly a Posting Virtuoso

Since "arTemp" is already declared in my previous code, use this.

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        With ListBox1
            If Not .SelectedIndex = -1 Then
                arTemp = .Items(.SelectedIndex).ToString.Split(":"c) '// .Split item in 2 Arrays.
                MsgBox(arTemp(0)) '// IP.
                MsgBox(arTemp(1)) '// Port.
            End If
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Here's something using a .txt file.

codeorder:myCoolPassword

Save that text or any text in a file, mine is "C:\loginCredentials.txt".
Make sure you separate the username and password with a ":".

And for the code, see if this helps.
1 Button, 2 TextBoxes

Public Class Form1
    Private myLoginCredentialsFile As String = "C:\loginCredentials.txt"
    Private myFileContent As String = Nothing

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If IO.File.Exists(myLoginCredentialsFile) Then myFileContent = IO.File.ReadAllText(myLoginCredentialsFile) '// load File.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text Like myFileContent.Substring(0, myFileContent.IndexOf(":")) Then '// check username.
            If TextBox2.Text Like myFileContent.Substring(myFileContent.IndexOf(":") + 1) Then '// check password.
            Else
                MsgBox("incorrect password")
                Exit Sub
            End If
        Else
            MsgBox("incorrect username")
            Exit Sub
        End If
        MsgBox("Login Successful")
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Why ask us?
Make a copy of a .exe, load that in your Hex Editor, then delete away and try to run the copy.
Do let us know how it goes.:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Button, 1 ListBox

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        getHTML("http://hidemyass.com/proxy-list/")
    End Sub

    Private myWebResponse As Net.HttpWebResponse
    Private myStream As IO.Stream
    Private myReader As IO.StreamReader

    Private Sub getHTML(ByVal siteURL As String)
        Me.Cursor = Cursors.WaitCursor
        Try
            myWebResponse = CType(Net.HttpWebRequest.Create(siteURL).GetResponse, Net.HttpWebResponse)
            myStream = myWebResponse.GetResponseStream()
            myReader = New IO.StreamReader(myStream)
            extractHTML(myReader.ReadToEnd, ListBox1)
            myReader.Close()
            myStream.Close()
            myWebResponse.Close()
        Catch ex As Exception
            MsgBox("There was a connection problem.", MsgBoxStyle.Critical)
        End Try
        Me.Cursor = Cursors.Default
    End Sub

    Private iSi, iEi As Integer, arTemp(), sTemp, sItemToAddToListBox As String

    Private Sub extractHTML(ByVal htmlContent As String, ByVal selListbox As ListBox)
        selListbox.Items.Clear()
        With htmlContent
            iSi = .IndexOf("<td>IP address</td>")
            iEi = .IndexOf("</table>", iSi)
            arTemp = .Substring(iSi, iEi - iSi).Split("/"c)
        End With
        sTemp = "<td><span>"
        For i As Integer = 0 To arTemp.Length - 1
            With arTemp(i)
                If .ToLower.Contains(sTemp) Then
                    sItemToAddToListBox = .Substring(.IndexOf(sTemp) + sTemp.Length).Replace("<", "")
                    sItemToAddToListBox &= ":" & arTemp(i + 2).Substring(.IndexOf("<td>") + 5).Replace("<", "")
                    selListbox.Items.Add(sItemToAddToListBox)
                End If
            End With
        Next
        MsgBox("done")
    End Sub
End Class
Alleyn commented: Amazingly Helpful +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim sfd As New SaveFileDialog
        With sfd
            .Title = "Save"
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                If IO.File.Exists(.FileName) Then
                    If MsgBox("Append Text to File?" & vbNewLine & "Clicking No will overwrite the current file.", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
                        '// append code here.
                    Else
                        '// overwrite code here.
                    End If
                Else '// if file does not exist.
                    '// overwrite code here.
                End If
            End If
        End With
codeorder 197 Nearly a Posting Virtuoso

Praise the..., uhmm... Praise the "jingda" that he put the thread back on track.

Benefit

codeorder 197 Nearly a Posting Virtuoso

"DUDE!!!", what's the hurry, we're not getting paid here. :D

See if this helps.

If Not CType(Me.Controls(TextBox1.Text), LinkLabel) Is Nothing Then
            With CType(Me.Controls(TextBox1.Text), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

Nice app. btw.:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private bSendToPrinter As Boolean = False

    Private Sub newScaleItem()
        '// code here to get item when placed on scale.
        '// If Not yourScale.Weight=0.0 Then
        bSendToPrinter = True
        printScaledItem()
        '// End If
    End Sub
    Private Sub printScaledItem()
        If bSendToPrinter Then
            bSendToPrinter = False
            '// Print code here.
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Option Strict On - msdn
Supposably, it makes you app. less prone to errors and/or crashing.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim x As String = "123.4567"
        x = x.Substring(0, x.IndexOf(".") + 3)
        MsgBox(x)

Btw, I believe Val is vb6 term and might get outdated soon.

codeorder 197 Nearly a Posting Virtuoso

I made this for someone back in March and it works with 4 Columns in a ListView.
1 ListView needed for testing.

Option Strict On
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListView1
            .Columns.Add("FirstName", 100) : .Columns.Add("LastName", 100) : .Columns.Add("Age", 100) : .Columns.Add("In Class?", 100) : .View = View.Details : .CheckBoxes = True : .FullRowSelect = True
            With .Items
                Dim lvItm As New ListViewItem("xnew,subitem,23,Yes".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("a 1new,1subitem,23,No".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("b 2new,2subitem,23,Yes".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("c 2new,1subitem,43,No".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("a 2new,2subitem,43,Yes".Split(CChar(",")))
                .Add(lvItm)
            End With
        End With
    End Sub

    Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView1.ColumnClick
        '// check if it contains items.
        If Not ListView1.Items.Count = 0 Then lvColumnSort(e.Column, ListView1) '// send Column Index and the ListView used.
    End Sub

#Region "================= SORT LISTVIEW COLUMNS BY SELECTED COLUMN ================="

    Private arlSortLvItems As New ArrayList '// adds ListView items to.
    Private bSortDescending As Boolean = True '// Toggles if .Ascending or Descending.

    Private Sub lvColumnSort(ByVal columnIndex As Integer, ByVal selectedListView As ListView)
        With selectedListView
            arlSortLvItems.Clear() '// clear ArrayList for new input.
            For Each itm As ListViewItem In .Items '// loop thru ListView.Items
                Select Case columnIndex '// check which column is clicked and add items to ArrayList as needed, first item will be the .Sorting item.
                    Case 0 '// FirstName, LastName, Age, InClass.
                        arlSortLvItems.Add(itm.Text & "~" & itm.SubItems(1).Text & "~" & itm.SubItems(2).Text & "~" & itm.SubItems(3).Text)
                    Case 1 '// LastName, …
codeorder 197 Nearly a Posting Virtuoso

You can also do it all in one line of code. Keeps fingers happy. :D

RichTextBox1.Text = IO.File.ReadAllText(Open.FileName)
codeorder 197 Nearly a Posting Virtuoso

Which line is giving you the error?

>>...the control rows after the removed row should be changed so it's still in sequential order.
Sequential order for the # at the end of each control's name or just moving the rows under the delete row up?

codeorder 197 Nearly a Posting Virtuoso

When you need a band name, you can get ideas from a band name maker website .

Innovation

codeorder 197 Nearly a Posting Virtuoso

You should try a "codeorder" search next time, might get better results. :D

Glad I could help. :)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// when adding new row of controls, add a Handler for your PictureBoxRemove.
        AddHandler PictureBoxRemove1.Click, AddressOf PictureBoxRemove_Click
        'AddHandler PictureBoxRemove2.Click, AddressOf PictureBoxRemove_Click
        'AddHandler PictureBoxRemove3.Click, AddressOf PictureBoxRemove_Click
    End Sub

    Private Sub PictureBoxRemove_Click(sender As System.Object, e As System.EventArgs)
        '// get name of sender and remove the name except for the end #.
        Dim sNumber As String = CType(sender, PictureBox).Name.Replace("PictureBoxRemove", "")
        With Panel1 '// your Panel.
            '// since you now have the # for the row, delete all controls that end w/that #.
            .Controls.Remove(CType(.Controls("PictureBoxAdd" & sNumber), PictureBox))
            .Controls.Remove(CType(.Controls("PictureBoxRemove" & sNumber), PictureBox))
            .Controls.Remove(CType(.Controls("TextBox" & sNumber), TextBox))
            .Controls.Remove(CType(.Controls("Button" & sNumber), Button))
        End With
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

I believe that lines 1,2, and 10, should all start with Public, not Private.
Line17 should be: frmMenu.intX = 5 , if intX is a Public declaration.

codeorder 197 Nearly a Posting Virtuoso

I wrote this a while ago. Not much to helping you learn what those options are, just how to use IntelliSense a little better. Hope it helps. :)
http://www.codeorder.net/pages/tutorial%20chapter/code-efficiently.html

codeorder 197 Nearly a Posting Virtuoso

I must have read your original post wrong, my apologies.

Since you are using Me.Hide in Form2 and not Me.Close, the Form2_Load event will only fire off the first time it loads, after that it hides and shows, does not reload.
You could use Me.Close or just set the value the Form2.Label right before showing Form2 again.

user1 = TextBox1.Text
        With Form2
            .Label1.Text = user1
            .Show()
        End With
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim myEntireCoolString As String = "(abc)random text here(cba)" '// your string.
        Dim xiStartIndex As Integer = myEntireCoolString.IndexOf("(abc)") + 5 '// locate the start Index.
        Dim xiEndIndex As Integer = myEntireCoolString.IndexOf("(cba)", xiStartIndex) '// locate the end Index.
        Dim myFoundCoolString As String = myEntireCoolString.Substring(xiStartIndex, xiEndIndex - xiStartIndex) '// extract content.
        myEntireCoolString = myEntireCoolString.Replace(myFoundCoolString, "something here to replace with") '// replace content.
        MsgBox(myEntireCoolString) '// get result.