codeorder 197 Nearly a Posting Virtuoso

how can I get this to navigate to each page and wait for the page to load then move to the next page

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

WebBrowser1.Navigate("http://www.google.com")


WebBrowser1.Navigate("http://www.daniweb.com/forums/post1312057.html#post1312057")


WebBrowser1.Navigate("http://social.msdn.microsoft.com/profile/karl%20grear/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/3086f3af-4665-4c79-8b21-e2ece36e50ae/")

WebBrowser1.Navigate("http://www.learnvisualstudio.net/")

End Sub

Since your question does not relate to this thread, Please Start a New Thread.
Also, since you posted code and if someone wants to find a similar solution, post the link to you New Thread here.
Thank you.

codeorder 197 Nearly a Posting Virtuoso

I have the following code set up under document complete but its still going through the code to fast. Is there a way to slow it down between sites?

The following code sample will get the innerHtml of a webpage every 5 seconds.
You will need the following prerequisites: WebBrowser, TextBox, Timer.

Public Class Form1
    Private iCount As Integer = 0

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 1000 '// 1 second delay for each tick.
        WebBrowser1.Navigate("http://www.daniweb.com/forums/post1311892.html#post1311892")
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        Timer1.Start()
    End Sub

    Sub pauseAndContinue()
        TextBox1.Text = WebBrowser1.Document.Body.InnerHtml
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If iCount = 5 Then '// pause for 5 seconds before calling the Sub procedure.
            Timer1.Stop()
            iCount = 0 '// reset timer.
            pauseAndContinue() '// go to procedure.
            Exit Sub '// skip the remaining code.
        End If
        iCount += 1
        Me.Text = iCount '// for testing purposes only.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

hello
you may use "settings" to store settings
project properties> settings> valid Boolean user false

then in the load event

If Not My.Settings.valid Then
            'ask for the serial
        End If

Just simplifying the above quote.

From the vb.net top Menu, click Project and select yourApplication Properties...
Locate the Settings Tab and add "valid" as your setting Name.
Change the Type to Boolean and set the Value to "False".

The following code should explain it's self.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.valid = True Then '// check if valid has been set to True
            Form2.Show()
            Me.Close()
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If My.Settings.valid = False Then
            If TextBox1.Text = "12345" And TextBox2.Text = "12345" And TextBox3.Text = "12345" _
                And TextBox4.Text = "12345" And TextBox5.Text = "12345" And TextBox6.Text = "12345" Then
                My.Settings.valid = True '// set the valid Setting to True
                My.Settings.Save() '// save your Settings
                Form2.Show()
                Me.Close()
            Else
                MsgBox("Incorrect Serial Number")
            End If
        Else
            Form2.Show()
            Me.Close()
        End If
    End Sub
End Class

The only way I could get the code to work was to set the Shutdown Mode to "When last form closes" in the Application Tab of the Project's Properties.

codeorder 197 Nearly a Posting Virtuoso

How did you have your application wait until the page was done loading before continueing?

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

    End Sub
codeorder 197 Nearly a Posting Virtuoso

HI,

pleae can any one help me regarding the issue: I am trying to develop system where i can add run time some user control like button, textbox, checkbox .

Thanks
suman

Adding controls without events, especially the ones mentioned, might be kind of pointless.
Since there is already a reply for creating a Dynamic textbox, I will add code for a Dynamic TextChanged event.

Here is an idea of how to get the proper procedure for each Dynamic event created, depending on the control.

Add a textbox to your form, double click it and you should see the following event.

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub

Remove the "Handles TextBox1.TextChanged" and if needed, rename it.

Private Sub txt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

Now you have an event to use, just no control to use it.:D

Here is complete code to create a Dynamic TextBox and give it an Event to use.
Code to create the textbox was located in the reply by "ÜnLoCo".

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// design your textbox.
        Dim tbox As New TextBox With {.Width = 200, .Name = "newtextbox", .Text = "hello", .Location = New Point(50, 100)}
        '// add the textbox to your Form.
        Me.Controls.Add(tbox)
        '// add an event handler for the textbox, and give it the address of the event to use.
        AddHandler tbox.TextChanged, …
codeorder 197 Nearly a Posting Virtuoso

If you are using the Try/Catch statement as the following code,

Try
            '// your code here that might cause the error.
        Catch ex As Exception
            MsgBox(ex.Message) '// display the default message, which in your case is probably the message your get.
        End Try

you can easily modify the Message to yours, like so.

Try
            '// your code here that might cause the error.
        Catch ex As Exception
            MsgBox("Found an Error, etc., etc., etc.", MsgBoxStyle.Critical, "Error") '// display your message.
        End Try
codeorder 197 Nearly a Posting Virtuoso

Thank you for the provided information, for it can be useful to refer to when working with web browsers.

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
        '// create a list of items.
        Dim myList() As String = {"item 1", "item 2", "item 3", "item 4", "item 5", "item 6", "item 7", "item 8", "item 9", "item 10"}
        '// add items to listboxes.
        ListBox1.DataSource = myList
        ListBox2.DataSource = myList
    End Sub

    Private Sub ListBox2_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.MouseHover
        '// since index starts at 0 for the first item, -1 would be an index of no item selected.
        If Not ListBox2.SelectedIndex = -1 Then '// if item is selected.
            ListBox1.SelectedIndex = ListBox2.SelectedIndex '// keep same selection.
            '// if Listbox displays scrollbars, the TopIndex will keep both Listboxes displaying the same items.
            ListBox1.TopIndex = ListBox2.TopIndex
        End If
    End Sub

    Private Sub ListBox1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.MouseHover
        If Not ListBox1.SelectedIndex = -1 Then
            ListBox2.SelectedIndex = ListBox1.SelectedIndex
            ListBox2.TopIndex = ListBox1.TopIndex
        End If
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

I have no references to using tcpComm, so I cannot "ok" your question.

codeorder 197 Nearly a Posting Virtuoso
Public Class Form1

    Private myFile() As String = IO.File.ReadAllLines("C:\!vb.net\temp.txt") '// load file.
    Private lineNumber As Integer = 0 '// keep track of which line to display.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 2000 '// 2 second delay.
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Not lineNumber = myFile.Count Then '// if not the end of the text file,
            TextBox1.Text = myFile(lineNumber) '// display line.
            lineNumber += 1 '// increase line number.
        Else
            lineNumber = 0 '// reset lines back to the first line.
        End If
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

I am sorry that I cannot be of further assistance due to the fact that I do not have any knowledge of using Sql Query or anything that has to do with Databases.

The code sample I have previously posted should give you a start at getting the information needed to search for the Employee Details.

codeorder 197 Nearly a Posting Virtuoso
Private Sub ListView1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseUp
        If ListView1.SelectedItems.Count > 0 Then
            MsgBox(ListView1.SelectedItems.Item(0).Index, MsgBoxStyle.Information)
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso

iam requesting a code for linking many forms

Form2.Show()
        Form3.Show()
        Form4.Show()
        Form5.Show()

If you have more Forms than the above code, just add them to the list.

codeorder 197 Nearly a Posting Virtuoso

For my knowledge, did .Dispose() stop the media content of that certain page after closing the tab?

About the memory usage, the possibility could be that the content from loading a web page is stored in the Temporary Internet Files folder and while your application is still active, the files remain stored in the memory.
The following code should load up the Temporary Internet Files folder.
Refresh Windows Explorer if needed after loading a page in your web browser.

Dim myFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)
        Process.Start(myFolder)

:-/ Would clearing the cache for the time you viewed pages in a tab help after closing the tab?
Would doing so, and viewing the same page, have your Processor work extra?

codeorder 197 Nearly a Posting Virtuoso

hae im trying to make a countdown timer can you tell me hoe to stop the time thanks
Hawre Eliassi

Public Class Form1

    Private myCounter As Integer = 60

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 100 '// tick every 1/10th of a second.
        Button1.Text = "Start"
        Me.Text = myCounter
    End Sub

    '// start and stop the timer.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Timer1.Enabled = False Then
            Timer1.Start()
            Button1.Text = "Stop"
        ElseIf Timer1.Enabled = True Then
            Timer1.Stop()
            Button1.Text = "Start"
        End If
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If myCounter = 0 Then
            Timer1.Stop() '// stop the timer.
            MsgBox("All Done.", MsgBoxStyle.Information)
            myCounter = 60 '// reset the timer.
            Button1.Text = "Start"
            Me.Text = myCounter
            Exit Sub '// skip the remaining code.
        End If
        myCounter -= 1 '// subtract 1 from the counter.
        Me.Text = myCounter
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso
Private mouse_Click As Integer = 0 '// keep track of clicks.

    Private Sub Button1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _
        Handles Button1.MouseClick, Button2.MouseClick, ListBox1.MouseClick, TextBox1.MouseClick, TextBox2.MouseClick, _
         TextBox3.MouseClick
        mouse_Click += 1 '// increase count by 1.
        Me.Text = mouse_Click
    End Sub
codeorder 197 Nearly a Posting Virtuoso

About displaying 2 message boxes, I somehow managed to put something together with setting a Boolean to True/False.

Private allowCheck As Boolean = True

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
       Select Case CheckBox1.Checked
            Case True
                allowCheck = False
                If MessageBox.Show("Are you sure you want to change the Header field values?" _
                                   , "Change Header Fields", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) _
                               = Windows.Forms.DialogResult.Yes Then
                    TextBox1.Enabled = True
                    TextBox2.Enabled = True
                    TextBox3.Enabled = True
                    allowCheck = True
                Else
                    CheckBox1.Checked = False
                    TextBox1.Enabled = False
                    TextBox2.Enabled = False
                    TextBox3.Enabled = False
                End If
            Case False
                If allowCheck = True Then
                    If MessageBox.Show("Are you sure? Doing so will cause all values to be reset to their defaults.", "Reset to Defaults?", MessageBoxButtons.YesNoCancel) = Windows.Forms.DialogResult.Yes Then
                        TextBox1.Enabled = False
                        TextBox2.Enabled = False
                        TextBox3.Enabled = False
                        TextBox1.Text = "AD.DF.Header.Ln01_DefaultText"
                        TextBox2.Text = "AD.DF.Header.Ln01_StartDate"
                        TextBox3.Text = "AD.DF.Header.Ln01_StartTime"
                    End If
                End If
        End Select
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CheckBox1.Checked = True
    End Sub

If it wasn't so late, the above code might actually make some sense to me :yawn: a little better, but overall, you should only get one msgbox per checkstate.

codeorder 197 Nearly a Posting Virtuoso

yeah good job bumping a 3!!! years old thread....

:D
I guess it is better to try and solve those threads, than to leave them unsolved and have them return empty from a search engine. Plus, replying to posts seems to help out with educating one self in vb.net.

Well, minus well...:icon_smile:

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Space Then
            Button1.PerformClick()
        End If
        If e.KeyCode = Keys.Enter Then
            Button2.PerformClick()
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.KeyPreview = True '// set KeyPreview to True and not have other controls take Focus from the keys pressed.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("Button1_Clicked", MsgBoxStyle.Information)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        MsgBox("Button2_Clicked", MsgBoxStyle.Question)
    End Sub
codeorder 197 Nearly a Posting Virtuoso

If you follow the Example from the following link,
http://en.wikipedia.org/wiki/Apriori_algorithm
you should be able to figure out the algorithm yourselves.

codeorder 197 Nearly a Posting Virtuoso

If you Append text to a File for each week worked, and save each day's date, hour logged in, hour logged out, and the total hours worked for the day in one line, you should easily access the information and get a sum total for the week. Here is an example on how to combine and split lines:

Public Class Form1

    Private userFile As String = "C:\!vb.net\userFile.txt"

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = Date.Today : Button1.Text = "Save Hours" : Button2.Text = "Total Hours"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox4.Text = CInt(TextBox3.Text) - CInt(TextBox2.Text) '// assuming hours are between 1 and 12.
        Dim w As New IO.StreamWriter(userFile, True) '// setting it True will Append text to the file.
        '// write the textbox's content and separate each textbox's value by a character, in this case "~".
        w.WriteLine(TextBox1.Text & "~" & TextBox2.Text & "~" & TextBox3.Text & "~" & TextBox4.Text)
        w.Close() : w.Dispose()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim lines() As String = IO.File.ReadAllLines(userFile)
        Dim totalHours As Integer = 0
        For Each line As String In lines
            Dim array() As String = line.Split("~") '// split the line.
            totalHours += array(3) '// get the 4th item, index of 3.
        Next
        MsgBox("Total Hours Worked: " & totalHours) '// show total hours.
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

You should be able to use the _MouseDown and _MouseUp events to trigger to outlook of the image.

Public Class Form1

    Private imgX As Image = Image.FromFile("C:\!vb.net\images\x.png")
    Private imgXclicked As Image = Image.FromFile("C:\!vb.net\images\x_clicked.png")

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.BackgroundImageLayout = ImageLayout.Stretch
        Button1.Image = imgX
    End Sub

    Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
        Button1.Image = imgXclicked
    End Sub

    Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp
        Button1.Image = imgX
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

The following solution should help.

First, locate the Textbox on each Tab that you would like to have selected when changing Tabs, and add a "_X" to the end of the Textbox's Name. For example, Textbox1 would now be named Textbox1_X.

Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged
        For Each ctl As Control In TabControl1.SelectedTab.Controls
            If TypeOf ctl Is TextBox And ctl.Name.EndsWith("_X") Then
                ctl.Select()
                Exit For
            End If
        Next
    End Sub

If you have not put the Textbox's Tag property to better use, you can always add a Tag to the Textbox that needs to be selected.
Example: TextBox1.Tag="select", and change the "If TypeOf ctl..." line of code to the following.

If TypeOf ctl Is TextBox And ctl.Tag = "select" Then
codeorder 197 Nearly a Posting Virtuoso

Is there such a code...

Of course.:)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim txt As New TextBox With {.Multiline = True, .ScrollBars = ScrollBars.Vertical, .Dock = DockStyle.Fill}
        Dim newForm As New Form
        newForm.Controls.Add(txt)
        Dim myFile As String = "C:\!vb.net\temp.txt" '// change this to your file's location.
        Dim r As New IO.StreamReader(myFile)
        txt.Text = r.ReadToEnd
        r.Close() : r.Dispose()
        newForm.Text = IO.Path.GetFileName(myFile)
        newForm.Show()
    End Sub
codeorder 197 Nearly a Posting Virtuoso

I hope I'm in the proper Forum for posting the following solution. :icon_eek:

Dim myChars() As Char = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
        Dim idString As String = ""
        For idLength As Integer = 0 To 9 '// this will return a 10 character ID number.
            Dim i As Integer = Rnd() * (myChars.Length - 1)
            idString &= myChars(i)
        Next
        MsgBox(idString)
codeorder 197 Nearly a Posting Virtuoso

Just adding my 2 cents worth.

In the File Menu, Project/Properties, Application Tab, you can locate the Shutdown Mode: Options which allow you to Shutdown the application "When startup form closes" or "When last form closes".

Selecting when last form closes, always show the other form first, then close the current one. example:

Form2.Show()
        Me.Close()

Closing a Form, the current data set on the Form will be reset to the original data of the Form. For example, having a Textbox on Form1 and using the above code, if you had text typed into the Textbox, the text will be lost.

In the case that you want to keep the data as is on a Form, use the .Hide() option.

codeorder 197 Nearly a Posting Virtuoso

Depending on the .NET Framework you designed your application with, if it is designed in vb.net, then as deepdotnet mentioned, you will need the .NET Framework installed on the foreign computer.
View the following links for the 2.0 and 1.1 .NET Frameworks.
Microsoft .NET Framework Version 2.0 Redistributable Package (x86)
Microsoft .NET Framework Version 1.1 Redistributable Package

I have not had any use to install a .NET Framework on any foreign computers for running my applications, so I do not know for certain that the above links will fix the problem.

The best suggestion I can offer is that you should always have the .NET Framework along with your software, possibly on a CD.

sumit.khera's reply of "give me the path by which i can download the vb.net software", if understood correctly, you can download Visual Basic.Net from the following link.
http://www.microsoft.com/express/Downloads/
Otherwise, if the reply was towards locating the .NET Frameworks, i hope my previously posted links are of use.

codeorder 197 Nearly a Posting Virtuoso

I am not quite clear of what you are trying to achieve, except that you want to double click an item in a Listview and get the values of a item and subitems in a row.

If I am on the right path, the following code snippet should help.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListView1
            .Columns.Add("col 1", 55) : .Columns.Add("col 2", 100) : .Columns.Add("col 3", 75)
            .View = View.Details : .FullRowSelect = True
            Dim newItem As New ListViewItem
            newItem.Text = "empcode"
            newItem.SubItems.Add("empcode details")
            newItem.SubItems.Add("empcode address")
            .Items.Add(newItem)
            Dim newItem2 As New ListViewItem
            newItem2.Text = "empname"
            newItem2.SubItems.Add("empname details")
            newItem2.SubItems.Add("empname address")
            .Items.Add(newItem2)
        End With
    End Sub

    Private Sub ListView1_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListView1.MouseDoubleClick
        Dim selItem As String = ListView1.SelectedItems.Item(0).Text
        Dim selItemSub1 As String = ListView1.SelectedItems.Item(0).SubItems(1).Text
        Dim selItemSub2 As String = ListView1.SelectedItems.Item(0).SubItems(2).Text
        MsgBox("selected row: " & ListView1.SelectedItems.Item(0).Index + 1 _
               & vbCrLf & selItem & " - " & selItemSub1 & " - " & selItemSub2)
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso

I had problems in the past publishing as well, just not sure if it was the same error, but it sounds like it was the same problem.

One solution I have found, was to use a 3rd party setup installer, like Inno Setup.
Then I would simply build the application, locate it in the bin/release folder, and add it along with the folders/files to the Inno Setup installer.

To fix the problem without using Inno Setup, I had to reinstall vb.net Express, which after a few more publishes, it would error once more.

codeorder 197 Nearly a Posting Virtuoso

I can spot one error.
Placing..

Dim check As Integer

in the same event as the rest of the code posted, you will always get a

MsgBox("data has been entered")

By Dimming something as an integer, it automatically sets it's self to 0, unless Dimmed as =2, 5, etc...

The rest of the code, i got 6 errors just by copy and pasting, so i would say, nope, your code is not correct.

codeorder 197 Nearly a Posting Virtuoso
Public Class Form1

    Sub keepCentered()
        Dim x As Integer = CInt((Me.Left + (Me.Width - Form2.Width) / 2))
        Dim y As Integer = CInt((Me.Top + (Me.Height - Form2.Height) / 2))
        Form2.Location = New Point(x, y)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form2.Show()
        Form2.TopMost = True
        keepCentered()
        Me.Location = New Point(1290, 155)
    End Sub

    Private Sub Form1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Move
        keepCentered()
    End Sub

End Class
xfrolox commented: Cuz it worked :P +1
codeorder 197 Nearly a Posting Virtuoso

Quite simple.
Add a Panel to your Form, place all the controls you would like not to be accessed in it, and disable the Panel. After your code is done processing, set it back to Panel1.Enabled=True.
If you disable the Form, you cannot access it, as to closing or moving the Form.

codeorder 197 Nearly a Posting Virtuoso
Dim lines As String() = IO.File.ReadAllLines("C:\!vb.net\temp.txt") '// your file here
        For i As Integer = 4 To lines.Count - 1 '// start at line 5
            ListView1.Items.Add(lines(i))
        Next
codeorder 197 Nearly a Posting Virtuoso

:icon_wink:

codeorder 197 Nearly a Posting Virtuoso

I have never heard of a "Thumbnail control box", but it seems that when you click an image in it, it uses something as

Process.Start("c:\your image location here.png")

which loads the file in the default viewer/editor.

If you want to load the image on another form, add a Form2 to you application and add a Picturebox to the form.
You should be able to get your image location, or full path, when clicking on a image in your "Thumbnail control box", so instead of using Process.Start, use the following code.

Dim newForm As New Form2
        newForm.PictureBox1.Image = Image.FromFile("c:\your image location here.png")
        newForm.Show()
codeorder 197 Nearly a Posting Virtuoso

I have never used vb6, but in vb.net if you want to add an item to a listbox, you would use...

ListBox1.Items.Add("Hello")
codeorder 197 Nearly a Posting Virtuoso

I am not for certain, but unless you dispose of a control, it could still be taking up space. Try adding this piece of code right before you remove the tab.

TabControl1.SelectedTab.Controls(0).Dispose()
codeorder 197 Nearly a Posting Virtuoso

Assuming that you are using the vb.net webbrowser, read on.
If this is for a login to a website, the link should have an Id. For example, using the following html page to navigate to,

<html><head><title>Untitled Page</title></head>
<body>
<a href="http://www.daniweb.com" id="myLink">to be clicked link</a>
</body>
</html>

and using the following code to get the proper link by id,

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        For Each link As HtmlElement In WebBrowser1.Document.Links
            If link.Id = "myLink" Then
                WebBrowser1.Navigate(link.GetAttribute("href"))
                Exit For
            End If
        Next
    End Sub

my webbrowser navigates to http://www.daniweb.com.

codeorder 197 Nearly a Posting Virtuoso

Here is something simple using a picturebox, listbox, timer, and a button.

Public Class Form1

    Private myFolder As String = "C:\!vb.net\images\" '// your images folder.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each img As String In My.Computer.FileSystem.GetFiles _
            (myFolder, FileIO.SearchOption.SearchTopLevelOnly, "*")
            ListBox1.Items.Add(IO.Path.GetFileName(img)) '// load all files from folder into a listbox.
        Next
        Timer1.Interval = 2000
        PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox1.SelectedIndex = 0 '// select an item.
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If Not ListBox1.SelectedIndex = ListBox1.Items.Count - 1 Then '// if not last item.
            ListBox1.SelectedIndex += 1
            PictureBox1.Image = Image.FromFile(myFolder & ListBox1.SelectedItem)
        Else '// if last item selected.
            ListBox1.SelectedIndex = 0
            PictureBox1.Image = Image.FromFile(myFolder & ListBox1.SelectedItem)
        End If
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso
Dim tempList As New List(Of String) '// create temp list.
        For Each itm As String In ListBox1.Items '// loop thru listbox.
            If itm.Length > 7 Then '// to not get errors, check if item's length is greater than 7.
                tempList.Add(itm.Substring(0, 7)) '// if greater than 7, get the substring.
            Else
                tempList.Add(itm) '// if less than 7, add item as is.
            End If
        Next
        ListBox1.Items.Clear()
        ListBox1.DataSource = tempList '// add items back to the listbox.