codeorder 197 Nearly a Posting Virtuoso

>>The problem is its not removing the File names that are stored
If it is for ListBox2, to have items removed, you need to loop backwards thru the ListBox and remove the .Items.

With ListBox2
            For i As Integer = .Items.Count - 1 To 0 Step -1
                .Items.Remove(.Items(i))
            Next
        End With

Looping forward and removing items will cause it to crash since it is looking for the .Count that was first set, and it constantly changes to .Count -=1.

Hope this helps.:)

Unhnd_Exception commented: FU -2
codeorder 197 Nearly a Posting Virtuoso

First off, the code below is not functional as needed and it will throw an Exception.

Imports System.IO
Public Class Form1
    Public myFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\"
    Private myScoreFile As String = myFolder & "scoreFile.txt", myGameDatesFile As String = myFolder & "gameDatesFile.txt"
    Private arMain(), sDateFormat As String, iMyCurrentGameDay As Integer

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            test()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub test()
        If File.Exists(myScoreFile) Then
            arMain = File.ReadAllLines(myScoreFile) '// read.File.
            If Not arMain.Length = 0 Then '// if .File has content.
                With arMain(0).ToString '// With line1.
                    If .Contains(",") Then
                        iMyCurrentGameDay = .Split(","c).Length - 1 '// get Total games played, from scoreFile.txt.
                    End If
                End With
                If File.Exists(myGameDatesFile) Then
                    arMain = File.ReadAllLines(myGameDatesFile) '// read.File.
                    sDateFormat = "dd/mm/yyyy"
                    For i As Integer = 0 To arMain.Length - 1
                        With arMain(i)
                            If CDate(Format(.ToString, sDateFormat)) > CDate(Format(Now, sDateFormat)) Then
                                ' MsgBox(.ToString)
                            End If
                        End With
                    Next
                End If
            End If
        End If
    End Sub
End Class

I tried to wrap my head around your issue for the past hour+ and with other projects in mind, I have to leave it as is, beta.code.
I hope IT.might help to figure out how to get the Total.games played and compare them to the gameDates, or at least give you another suggestion that might eventually lead to a solution.

The scoreFile, I edited to only contain 3games and I even created a separate gameDatesFile. Since I'm a hobbyist …

codeorder 197 Nearly a Posting Virtuoso

Glad I could help in more ways than1, "coz".:)
.Now mark your sh.t as Solved before I start the cussing, and it won't involve anything about hotties.:D

codeorder 197 Nearly a Posting Virtuoso

To add images or any file/files to My.Resources, follow these little steps.

First, check out the 3attached.images, in the order they appear.
2nd, you're done.:)

With PictureBox1
            .Image = My.Resources.jessica_alba
        End With

3rd, Jessica Alba is a hottie.:*

y2kshane commented: thnx +2
codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso

Post some scoreFile.txt content andAlso add a few more details regarding the dates used.
I just woke up and w/out a hangover, it is difficult to make sense about:
.If 2dates passed, use the most recent date of the 2?
.What happens if 3+ dates passed?
.Who adds the dates to be used?;a randomGenerator/you/user?
One more thing, post format of date being used.

codeorder 197 Nearly a Posting Virtuoso

8 Hours Ago

>>adding form name has solved the problem

Not marking the thread as Solved, gave me a problem? and I have no problematic questions.(sigh) I would cuss you out, though it's morning and I already cussed out a neighboor; hope the previous sentence takes care of your "other" problem, not keeping it IT in an IT forum.

Other than that, glad I could help.:)

codeorder 197 Nearly a Posting Virtuoso

Have you tried adding the Form's.Name just prior to your Cmd_New.Enabled... ?

Example: Form1.Cmd_New.Enabled = False

Unhnd_Exception commented: I guess the same reason as yours. -2
codeorder 197 Nearly a Posting Virtuoso

.not tested, though I hope it helps.

Public Class Form1
    Private CellID1(), CellID2(), CellID3(), CellID4(), CellID5(), CellID6(), CellID7(), CellID8(), CellID9(), CellID10() As String
    Private MapItems(20) As String
    Private i As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Select Case i
            Case 0
                setCells(New Array() {CellID1, CellID2, CellID3}, New Integer() {1, 2, 3})
            Case 1
                setCells(New Array() {CellID4, CellID5, CellID6}, New Integer() {4, 5, 6})
            Case Else
                MsgBox(".hope and live to never Not.hope.", MsgBoxStyle.Information)
        End Select
    End Sub

    Private Sub setCells(ByVal selCells() As Array, ByVal selMapItems() As Integer)
        For i As Integer = 0 To selCells.Length - 1
            selCells(i) = MapItems(selMapItems(i)).Split(","c)
        Next
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps to create Dynamic.TextBoxes on a Form.

Public Class Form1
#Region "----===----===----===----- myCoolDYNAMICS  -----===----===----===----"
    Private Sub createCoolTextBoxes()
        '// # at end of TextBox, location from Left to Right, location from Top to Bottom.
        Dim iCoolNumberForName As Integer = 1, iLeftLocation As Integer = 5, iTopLocation As Integer = 5
        '// create Dynamic.TextBox.
        Dim txt As New TextBox With {.Name = "TextBox" & iCoolNumberForName.ToString, .Left = iLeftLocation, .Top = iTopLocation, .Text = .Name}
        Me.Controls.Add(txt) '// add txtBox to Form.
        iCoolNumberForName += 1 : iLeftLocation += 5 : iTopLocation += 25
        txt = New TextBox With {.Name = "TextBox" & iCoolNumberForName.ToString, .Left = iLeftLocation, .Top = iTopLocation, .Text = .Name}
        Me.Controls.Add(txt) '// add txtBox to Form.
        iCoolNumberForName += 1 : iLeftLocation += 5 : iTopLocation += 25
        txt = New TextBox With {.Name = "TextBox" & iCoolNumberForName.ToString, .Left = iLeftLocation, .Top = iTopLocation, .Text = .Name}
        Me.Controls.Add(txt) '// add txtBox to Form.
        '// etc./etc.
    End Sub
#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        createCoolTextBoxes()
    End Sub
End Class

As for getting values from your new TextBoxes, check out this recent post of mine. The second part of code, w/the sTemp &= CType(Me.Controls([B]"TextBox" & i[/B].ToString), TextBox).Text ; i being iCoolNumberForName in the above code.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private sTemp As String = Nothing '// TEMP String.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        sTemp = "" '// clear for new input.
        For Each myCoolTextBox In New TextBox() {TextBox1, TextBox2, TextBox3} '// your TextBoxes.
            sTemp &= myCoolTextBox.Text '// add to Strings using "&" and add.#'s up using "+", less confusing. :)
        Next
        MsgBox(sTemp) '// result.
    End Sub

AndAlso :

Private sTemp As String = Nothing, iCoolNumberOfBoxes As Integer = Nothing
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        iCoolNumberOfBoxes = 3 '// set as needed.
        sTemp = "" '// clear for new input.
        For i As Integer = 1 To iCoolNumberOfBoxes
            sTemp &= CType(Me.Controls("TextBox" & i.ToString), TextBox).Text
        Next
        MsgBox(sTemp) '// result.
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps to terminate the application from any Form.

Public Class Form1
#Region "----===----===----===----- EVENT HANDLERS -----===----===----===----"
    Private Sub _myCoolForms_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs)
        Application.Exit()
    End Sub
#End Region

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each frm In New Form() {Me, Form2, Form3} '// your Forms.
            '// add an Event Handler to all Forms for FormClosing.
            AddHandler frm.FormClosing, AddressOf _myCoolForms_FormClosing
        Next
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
        Form3.Show()
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Not case-sensitive? WTF? You gonna pay extra for that or are you just asking for a freebie? :D

See if this helps.:)

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        With ListBox1
            .SelectedIndex = -1 '// -1 Index ='s No.Item.Selected.
            If Not TextBox1.Text = "" Then
                For Each itm As String In .Items '// loop thru items.
                    If itm.ToLower = TextBox1.Text.ToLower Then '// Case inSensitive search.
                        .SelectedItem = itm '// select item.
                        Exit For '// exit loop since item located. 
                    End If
                Next
                Exit Sub '// just.because the next 2 lines are not worth reading. :)
            End If
        End With
    End Sub
Riteman commented: Thanks! +1
codeorder 197 Nearly a Posting Virtuoso

Also, see if this helps.

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        With ListBox1
            If .Items.Contains(TextBox1.Text) Then .SelectedItem = TextBox1.Text Else .SelectedIndex = -1
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Saw that you just posted, sucks for you.:D
.At least you got a .Value added to your TextBox so far. Before you post again, My.Suggestion = "keep fiddleling" .

codeorder 197 Nearly a Posting Virtuoso

Keep that in the btnCalculateOrder.Click event and replace this event entirely.

Private Sub DriversLicense_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriversLicense.TextChanged
            DriversLicenseString = DriversLicense.Text
        End Sub
codeorder 197 Nearly a Posting Virtuoso

>>the drivers license doesn't appear in the Drives License TextBox on the bottom after you input it.

Drives License TextBox.Text = DriversLicenseString

That should be located somewhere w/in your code, if you want it to display anything.

codeorder 197 Nearly a Posting Virtuoso

>>...I can't implement it based on the above condition:
;)

Imports System.IO

Public Class Form1
    Private arTemp() As String, iT As Integer
    Private myCoolFileExtension As String = "*.tif"
    Private myCool16File As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\withbar.txt"
    Private myOtherFile As String

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim fbd As New FolderBrowserDialog
        If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then
            getDirectoryList(fbd.SelectedPath, ListBox1)
            MsgBox("(:.done.:)")
        End If
    End Sub

    Private Sub getDirectoryList(ByVal selCoolFolderPath As String, ByRef selCoolListBox As ListBox)
        For Each foundDirectory In Directory.GetDirectories(selCoolFolderPath)
            Select Case Directory.GetFiles(foundDirectory, myCoolFileExtension).Length '// check File.Count.
                Case 16
                    renameFiles(foundDirectory, myCool16File)
                Case Else
                    '  renameFiles(foundDirectory, myOtherFile)
            End Select
            getDirectoryList(foundDirectory, selCoolListBox)
        Next
    End Sub

    Private Sub renameFiles(ByVal selCoolFolder As String, ByVal selFile As String)
        arTemp = File.ReadAllLines(selFile) : iT = 0
        For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _
                                                    (selCoolFolder, FileIO.SearchOption.SearchTopLevelOnly, myCoolFileExtension)
            If Not Path.GetFileName(myCoolFile) = arTemp(iT) Then
                If Not File.Exists(Path.GetDirectoryName(myCoolFile) & "\" & arTemp(iT)) Then
                    My.Computer.FileSystem.RenameFile(myCoolFile, arTemp(iT))
                Else
                    ' //.error.More files in folder than there are file.names in .txt file.
                    Exit For
                End If
            End If
            If Not iT = arTemp.Length - 1 Then
                iT += 1
            End If
        Next
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

>>I tried it, but it didn't work.
Sucks for you?:D

Just wondering; how is DriversLicenseString 's value displayed in your TextBox?

codeorder 197 Nearly a Posting Virtuoso

I have a feeling that line.66 in your code should be: DriversLicenseString = DriversLicense.Text

codeorder 197 Nearly a Posting Virtuoso
Dim myCoolFile As String = "C:\test.txt" '// your original file.
        Dim myRenamedCoolFile As String = "testRenamed.txt" '// only your new file name and extension.  file extension can be changed.

        If IO.File.Exists(myCoolFile) Then
            My.Computer.FileSystem.RenameFile(myCoolFile, myRenamedCoolFile)
            MsgBox("File Renamed.", MsgBoxStyle.Information)
        Else
            MsgBox("File Does Not Exist.", MsgBoxStyle.Critical)
        End If
codeorder 197 Nearly a Posting Virtuoso

.Remove: setFullName() from the 2 _TextChanged events and only add it to your "btnCalculateOrder".Click.

>>...can't get the driver's license part to work...
.and the part you can't get to work is?

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub FirstName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FirstNameTextBox.TextChanged
            FirstNameTextBoxString = FirstNameTextBox.Text
			setFullName()
        End Sub

        Private Sub LastName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LastNameTextBox.TextChanged
            LastNameTextBoxString = LastNameTextBox.Text
			setFullName()
        End Sub
		
		Private Sub setFullName()
		FullNameTextBoxString = FirstNameTextBoxString & " " & LastNameTextBoxString
		FullNameTextBox.Text = FullNameTextBoxString
		End Sub
codeorder 197 Nearly a Posting Virtuoso

>>thanks codeorder, i'll try it now.
:)
>>I'd rather be fishing.
I'd rather be skating. xD

codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 ListBox, 1 Button

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim fbd As New FolderBrowserDialog
        If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then
            With ListBox1.Items
                .Clear()
                getDirectoryList(fbd.SelectedPath, ListBox1)
                MsgBox("Found.Directory(ies).Count: " & .Count)
            End With
        End If
    End Sub

    Private Sub getDirectoryList(ByVal selCoolFolderPath As String, ByRef selCoolListBox As ListBox)
        For Each foundDirectory In Directory.GetDirectories(selCoolFolderPath)
            With ListBox1
                .Items.Add("file.count: (" & IO.Directory.GetFiles(foundDirectory, "*.*").Length & ") file.path: " & foundDirectory)
                .SelectedIndex = .Items.Count - 1
            End With
            getDirectoryList(foundDirectory, selCoolListBox)
        Next
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Button

Public Class Form1
    Private sTemp1, sTemp2 As String

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        sTemp1 = "" : sTemp2 = ""
        Dim fbd As New FolderBrowserDialog
        With fbd
            .Description = "Select a folder to copy the content FROM..."
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                sTemp1 = .SelectedPath
            End If
            .Description = "Select a folder to copy the content TO..."
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                sTemp2 = .SelectedPath
            End If
            If Not sTemp1 = "" OrElse Not sTemp2 = "" Then copyDirectory(sTemp1, sTemp2)
        End With
    End Sub

    Private Sub copyDirectory(ByVal selTargetPath As String, ByVal selDestinationPath As String)
        sTemp1 = ""
        If Not IO.Directory.Exists(selDestinationPath) Then IO.Directory.CreateDirectory(selDestinationPath)
        For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _
                                                 (selTargetPath, FileIO.SearchOption.SearchTopLevelOnly, "*.*")
            sTemp1 = selDestinationPath & "\" & IO.Path.GetFileName(myCoolFile)
            If Not IO.File.Exists(sTemp1) Then
                IO.File.Copy(myCoolFile, sTemp1)
            Else
                MsgBox("File.Exists, cannot copy." & vbNewLine & sTemp1, MsgBoxStyle.Information)
            End If
        Next
        MsgBox(".done.", MsgBoxStyle.Information)
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Since "new" to vb.net, see if this helps.
1 ListBox, 1 PictureBox
...and a Folder with a few images.

Public Class Form1
    '// set this Folder to your ImagesFolder.
    Private myCoolImgsFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\.TEMP\just.because\"

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        With PictureBox1 '// shorten code:) and set some Properties for the PictureBox.
            .BackColor = Color.Black
            .SizeMode = PictureBoxSizeMode.Zoom
        End With
        '// load Files if the Folder.Exists.
        If IO.Directory.Exists(myCoolImgsFolder) Then
            loadMyCoolFilesToListBox(myCoolImgsFolder, ListBox1)
        Else
            MsgBox("Images Folder Does Not Exist.", MsgBoxStyle.Information)
        End If
    End Sub

    Private Sub loadMyCoolFilesToListBox(ByVal selCoolFolder As String, ByVal selListBox As ListBox, Optional ByVal selFileExtension As String = "*.*")
        For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _
                                                    (selCoolFolder, FileIO.SearchOption.SearchTopLevelOnly, selFileExtension)
            selListBox.Items.Add(IO.Path.GetFileName(myCoolFile)) '// add file name with extension.
        Next
    End Sub

    Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        With ListBox1
            If Not .SelectedIndex = -1 Then '// If item selected.
                PictureBox1.ImageLocation = myCoolImgsFolder & .SelectedItem.ToString '// load image from Folder.
                Me.Text = .SelectedItem.ToString '// just.because :)
            End If
        End With
    End Sub
End Class

If you only need to load a certain file.extension type, you can use something as: loadMyCoolFilesToListBox(myCoolImgsFolder, ListBox1, "*.png") , otherwise it will load all files by default.

codeorder 197 Nearly a Posting Virtuoso

Are you still having issues w/this project?:
>>The current questions i have got are:

Or are you just somewhat spamming your own thread?:D (since no question(s) was/were asked in your previous reply)

codeorder 197 Nearly a Posting Virtuoso

>>doesnt seem to load the txt file i have created.
Post a few of the file content lines.
>>it come up with the error:
I cannot recreate the error, although it could all be related to your file.content.
>>thanks
:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps for starters.
New Project(2 Buttons, 1 Label, 4 RadioButtons)

Public Class Form1

#Region "===----===----===----===----- DECLARATIONS  -----===----===----===----==="
    Public myCoolQuestionsAndAnswersFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\QandA.txt" '// your File.
    Private arlQandA As New ArrayList '// store all File.Lines in.
    Private iSelectedQuestion, iCorrectAnswer As Integer '// set the CurrentQuestion and the CorrectAnswer indexes.
    Private arT() As String '// TEMP String Array; .Splits the File.Line to get values.
#End Region

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        '// load File.
        If IO.File.Exists(myCoolQuestionsAndAnswersFile) Then
            arlQandA.AddRange(IO.File.ReadAllLines(myCoolQuestionsAndAnswersFile))
            setCoolQuestionAndAnswers(iSelectedQuestion)
        Else
            Button1.Enabled = False : Button2.Enabled = False
        End If
        Button1.Text = ".>Next Q." '// next Question.
        Button2.Text = ".check A." '// check Answer.
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        getNextCoolQuestionAndAnswers(iSelectedQuestion)
    End Sub '// next Question.

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        verifySelectedCoolAnswer()
    End Sub '// check Answer.

#Region "===----===----===----===----- QandA ZONE  -----===----===----===----==="

    Private Sub getNextCoolQuestionAndAnswers(ByVal selQuestionIndex As Integer)
        If Not arlQandA.Count - 1 = selQuestionIndex Then '// check if Not the selectedQuestion is the last Question in the ArrayList.
            selQuestionIndex += 1 '// set the QuestionIndex.
            setCoolQuestionAndAnswers(selQuestionIndex) '// set the Question.
        End If
    End Sub

    Private Sub setCoolQuestionAndAnswers(ByVal selQuestionIndex As Integer)
        arT = arlQandA(selQuestionIndex).ToString.Split(">") '// .Split current File line into Arrays.
        Label1.Text = arT(0) '// set first value.
        RadioButton1.Text = arT(1) '// set second value.
        RadioButton2.Text = arT(2) '// etc..
        RadioButton3.Text = arT(3)
        RadioButton4.Text = arT(4)
        iCorrectAnswer = CInt(arT(5))
    End Sub

    Private Sub verifySelectedCoolAnswer()
        For Each rb In New RadioButton() …
codeorder 197 Nearly a Posting Virtuoso

>>e.g Start with a capital.

With TextBox1
            .Text = StrConv(.Text, VbStrConv.ProperCase)
        End With
codeorder 197 Nearly a Posting Virtuoso
Dim myStartupFolderPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
codeorder 197 Nearly a Posting Virtuoso

Also, check out this thread in case you just need the FileNames, not FullPaths to display in ListBox.

codeorder 197 Nearly a Posting Virtuoso

Overlooking your code, I think this might help your little finger from scrolling so much and the rest of the world from not using the electricity to load similar code over and over again.

Private Sub clearBoxes()
        boxButton1.Text = ""
        boxButton2.Text = ""
        boxButton3.Text = ""
        boxButton4.Text = ""
        boxButton5.Text = ""
        boxButton6.Text = ""
        boxButton7.Text = ""
        boxButton8.Text = ""
        boxButton9.Text = ""
    End Sub

Other than that, see if this helps.

Public Class Form1
    Private sPlayer1 As String = "Player One"
    Private sPlayer2 As String = "Player Two"
    Private sPlayerInTurn As String = sPlayer1

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.Text = sPlayerInTurn
    End Sub

    Private Sub _boxButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles boxButton1.Click, boxButton2.Click, boxButton3.Click, boxButton4.Click '// etc...
        If sPlayerInTurn = sPlayer1 Then sPlayerInTurn = sPlayer2 Else sPlayerInTurn = sPlayer1
        Me.Text = sPlayerInTurn
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim x As String =  "<p><img src=""http://www.freesmileys.org/smileys/smiley-happy114.gif"" alt="""" title=""www.freesmileys.org"" />Hello World</p>"
        x &= "<center>"
        x &= "<span style=""font-size:25px;font-weight:bolder;"">From </span>"
        x &= "<a href=""http://www.daniweb.com/""><img src=""http://images.daniweb.com/logo.gif"" align=""middle"" border=""0"" alt="""" title=""DaniWeb IT Discussion Community"" /></a>"
        x &= "<br /><br /><img src=""http://www.freesmileys.org/smileys/smiley-happy020.gif"" alt="""" title=""www.freesmileys.org"" />"
        x &= "<br /><img src=""http://www.freesmileys.org/smileys/smiley-happy110.gif"" alt="""" title=""www.freesmileys.org"" />"
        x &= "<br /><img src=""http://www.freesmileys.org/smileys/smiley-happy095.gif"" alt="""" title=""www.freesmileys.org"" />"
        x &= "</center>"
        WebBrowser1.DocumentText = x

Basically, you have to set a String and only set the .DocumentText of the wb(WebBrowser) once.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub loadFile(ByVal myCoolSelectedFile As String)
        If IO.File.Exists(myCoolSelectedFile) Then
            Process.Start(myCoolSelectedFile)
        Else
            MsgBox("This file does not exist.")
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        loadFile("C:\someFile.someExtension")
    End Sub
sujimon commented: this helped me in my project !! +1
codeorder 197 Nearly a Posting Virtuoso

Read html code from where? A file? Your app.'s code lines?
Post html code sample that you want to display in your wb.

codeorder 197 Nearly a Posting Virtuoso

Then your rows are empty when first running the code.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.
Form99:

Public Class Form99
    Public selForm As Form = Nothing

    Private Sub frm99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.TextBox1.Text = CType(selForm.Controls("TextBox1"), TextBox).Text
        Me.TextBox2.Text = CType(selForm.Controls("TextBox2"), TextBox).Text
    End Sub
End Class

All other Forms:

With Form99
            .selForm = Me
            .Show()
        End With
codeorder 197 Nearly a Posting Virtuoso

Do you mean to run the links/buttons that you added to the .DocumentText?

codeorder 197 Nearly a Posting Virtuoso

I'm a bit confused on your new question.
What's not responding as needed? Does not Exit Sub?

codeorder 197 Nearly a Posting Virtuoso
If Not reader.HasRows Then
                        MsgBox("Data does not exist")
                    Else
                        MsgBox("Data Exists")
                        Exit Sub '// skip all remaining code in the Sub.
                    End If
codeorder 197 Nearly a Posting Virtuoso
Dim sDate As String = Date.Now.ToString("dd/MM/yyyy - hh:mm tt")
        MsgBox(sDate)
codeorder 197 Nearly a Posting Virtuoso
Public Class frm99
    Public sNameOfForm As String = Nothing

    Private Sub frm99_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MsgBox(sNameOfForm)
    End Sub
End Class

And for all other Forms:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With frm99
            .sNameOfForm = Me.Name
            .Show()
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Remove all the db(database) code from the Form and test. If it runs without issues, close this thread and start a new one regarding your "new" issue. Thanks in advance and glad I could provide assistance thus far.:)

codeorder 197 Nearly a Posting Virtuoso

.Caption from DevExpress? Kind of lame from my point of view, if it is just a .Text Property.

codeorder 197 Nearly a Posting Virtuoso

Line 17/18, uses .Caption, which I believe is vb6 for .Text. Change those to .Text and let us know the result on the foreign p.c. when trying to run the app..

codeorder 197 Nearly a Posting Virtuoso

Seems that the issue is not the code I provided, it is a issue within your app..
Post your frmLogin code for evaluation.

codeorder 197 Nearly a Posting Virtuoso
Dim myCoolPassWordFile As String = "C:\myPassword.txt"
        IO.File.WriteAllText(myCoolPassWordFile, TextBox1.Text)
codeorder 197 Nearly a Posting Virtuoso

Confusing question; care to share more in depth detailed info?