codeorder 197 Nearly a Posting Virtuoso

If you do not need to re-size the Panel's separations, even a blank Label that is set to AutoSize=False with a 3D border should do the trick.
Otherwise, check out the SplitContainer in the "Containers" tab of the vb.net Toolbox.

codeorder 197 Nearly a Posting Virtuoso
Dim tempStr As String = "C:\Reading files\bin\Debug\path.txt';"
        MsgBox(tempStr.Substring(0, tempStr.Length - 2)) '// "0" = start Index, "tempStr.Length - 2" = Substring length.
Trle94 commented: tnx :D +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'// code to get Scanned BarCode here.
        If Not TextBox1.Lines.Length = 0 Then '// check if TextBox contains text.
            TextBox1.Text &= vbNewLine & "my Scanned BarCode" '// add new line and BarCode.
        Else
            TextBox1.Text = "my Scanned BarCode" '// add BarCode.
        End If

With the above code, you should not have any "empty" lines in your TextBox.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'//------- Prerequisites: 1 ComboBox, 3 TextBoxes. -------\\
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ComboBox1.Items.Add("Mandatory") : ComboBox1.Items.Add("All") '// add items.
        ComboBox1.SelectedIndex = 0 '// select first option.
        ComboBox1.TabIndex = 999 '// set index presumably to very last index.
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Dim ctl() As Control = {TextBox1, TextBox2, TextBox3} '// set arrays of controls.
        Select Case ComboBox1.SelectedIndex
            Case 0
                ctl(0).TabIndex = "0"
                ctl(2).TabIndex = "1"
            Case 1
                ctl(0).TabIndex = "0"
                ctl(1).TabIndex = "1"
                ctl(2).TabIndex = "2"
        End Select
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'//------- Pre-requisites: 1 Button, 1 TextBox named "phonenumbertxtbox". -------\\
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With phonenumbertxtbox
            If Not .Text = Nothing Then '// check if not empty.
                If .Text.Length > 0 AndAlso .Text.Substring(0, 1) = "(" Then '// check if length is greater than 0 and if first char. is "(".
                    If .Text.Length > 4 AndAlso .Text.Substring(4, 1) = ")" Then '// check if length is greater than 4 and if 5th char. is ")".
                        If .Text.Length > 8 AndAlso .Text.Substring(8, 1) = "-" Then '// check if length is greater than 8 and if 9th char. is "-".
                            MsgBox("Correct")
                        Else : MsgBox("Incorrect")
                        End If
                    Else : MsgBox("Incorrect")
                    End If
                Else : MsgBox("Incorrect")
                End If
            End If
        End With
    End Sub


    Private Sub phonenumbertxtbox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles phonenumbertxtbox.KeyPress
        Select Case e.KeyChar
            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "(", ")", "-", vbBack '// your pre-selected Characters and Backspace.
                e.Handled = False '// allow.
            Case Else
                e.Handled = True '// block.
        End Select
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        phonenumbertxtbox.MaxLength = 13 '// set max. allowed characters.
    End Sub
End Class
Manny_1 commented: How can I convert this code without a button click +0
codeorder 197 Nearly a Posting Virtuoso

See if this is "simple" enough.

Dim dateBookIssued As Date = "5/24/2005" '// Month, Day, Year.
        Dim dateBookReturned As Date = "10/20/2010" '// Month, Day, Year.
        '// Subtract the Date book was Issued from Date book was Returned.
        Dim overdueTime As TimeSpan = dateBookReturned.Subtract(dateBookIssued)
        '// convert Total Days String to Integer and multiply by .15 cents for each day.
        Dim totalFeeCost As Decimal = CInt(overdueTime.Days.ToString) * 0.15
        '// display formatted Total Fee Cost.
        MsgBox(Format(totalFeeCost, "$#.00"))
codeorder 197 Nearly a Posting Virtuoso

Glad it is of use, although late night coding, and etc., I did make a slight code error.
This line..

Private myImg(10) As Bitmap '// create Bitmap Array to store images.

Should actually be -=1...

Private myImg(9) As Bitmap '// create Bitmap Array to store images.

I forgot my Index counting and hope that apology is accepted.

All the best,
codeorder.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private myImg(10) As Bitmap '// create Bitmap Array to store images.
    Private myImgAM As New Bitmap("C:\AM.png")
    Private myImgPM As New Bitmap("C:\PM.png")

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// add Images to Arrays in set order.
        myImg(0) = New Bitmap("C:\0.png")
        myImg(1) = New Bitmap("C:\1.png")
        myImg(2) = New Bitmap("C:\2.png")
        myImg(3) = New Bitmap("C:\3.png")
        myImg(4) = New Bitmap("C:\4.png")
        myImg(5) = New Bitmap("C:\5.png")
        myImg(6) = New Bitmap("C:\6.png")
        myImg(7) = New Bitmap("C:\7.png")
        myImg(8) = New Bitmap("C:\8.png")
        myImg(9) = New Bitmap("C:\9.png")
        '// start timer.
        Timer1.Enabled = True
    End Sub

    Private Sub displayTime()
        Dim x As String = Format(TimeOfDay, "hhmmsstt") '// get Hours, Minutes, Seconds, AM/PM.
        PictureBox1.Image = myImg(CInt(x.Substring(0, 1))) '// (h)hmmsstt.
        PictureBox2.Image = myImg(CInt(x.Substring(1, 1))) '// h(h)mmsstt.
        PictureBox3.Image = myImg(CInt(x.Substring(2, 1))) '// hh(m)msstt.
        PictureBox4.Image = myImg(CInt(x.Substring(3, 1))) '// hhm(m)sstt.
        PictureBox5.Image = myImg(CInt(x.Substring(4, 1))) '// hhmm(s)stt.
        PictureBox6.Image = myImg(CInt(x.Substring(5, 1))) '// hhmms(s)tt.
        If x.Substring(6, 2) = "AM" Then '// hhmmss(tt).
            PictureBox7.Image = myImgAM
        Else
            PictureBox7.Image = myImgPM
        End If
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        displayTime()
    End Sub
End Class
AndreRet commented: Nicely executed. +4
codeorder 197 Nearly a Posting Virtuoso

Basically, you want the timer to keep looping until .wav file finished?
If so, set the timer to the length of the .wav file's sound.

codeorder 197 Nearly a Posting Virtuoso

See if this helps about the sound issues.
http://www.daniweb.com/forums/post772157.html#post772157

codeorder 197 Nearly a Posting Virtuoso

Since my above post has gotten me a Negative Vote, I'm just wondering...
"Are we not supposed to understand/simplify the question in order to provide a better solution?".

codeorder 197 Nearly a Posting Virtuoso

Edit: Double posted since DaniWeb took too long to Submit/Load webpage.

codeorder 197 Nearly a Posting Virtuoso

See if this helps, if not, do post code.

Dim tempStr As String = RichTextBox1.Rtf '// store Format into String.
        RichTextBox1.Clear() '// clear if needed.
        If RichTextBox1.WordWrap = True Then : RichTextBox1.WordWrap = False : Else : RichTextBox1.WordWrap = True : End If '// toggle WordWrap.
        RichTextBox1.Rtf = tempStr '// set Formated text back.
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'//-------------- Pre-requisites: 1 ProgressBar, 1 Timer, 1 Button, 2 Forms. --------------\\
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ProgressBar1.Maximum = 100 '// set the Maximum allowed progress.
        Timer1.Start() '// Start the Timer to keep status of ProgressBar.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not ProgressBar1.Value = 100 Then ProgressBar1.Value += 25 '// check if not at Maximum to not go over, then add some value.
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If ProgressBar1.Value = 100 Then '// check if ProgressBar is at Maximum Value.
            Timer1.Stop() '// stop the Timer FIRST, then...
            ProgressBar1.Visible = False '// set ProgressBar visibility to False.
            Form2.Show() '// show another Form.
        End If
    End Sub
End Class

It can also be done without a Timer.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not ProgressBar1.Value = 100 Then ProgressBar1.Value += 25 '// check if not at Maximum to not go over, then add some value.
        If ProgressBar1.Value = 100 Then '// check if ProgressBar is at Maximum Value.
            ProgressBar1.Visible = False '// set ProgressBar visibility to False.
            Form2.Show() '// show another Form.
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso
Dim myCoolFile As String = "C:\test.txt" '// your file location.
        Dim tempStr As String = IO.File.ReadAllText(myCoolFile) '// read file into a String.
        Dim x As Integer = tempStr.Length - 1 '// get String length, Index based, starting at 0 not 1.
        Dim myArray(x) As String '// create your String Arrays.
        Dim i As Integer = 0 '// Integer used to increase Array #'s.
        For Each myChr As Char In tempStr '// loop thru each each character in the String.
            myArray(i) = myChr '// add values to each String Array.
            i += 1 '// increase count for next Array.
        Next
        MsgBox(myArray(2)) '// display result for 3rd character.
codeorder 197 Nearly a Posting Virtuoso

Not so clear on your reply.
Does your File only contain one line of "TFTTTTTTFFTFTFTTTTFF"?, and are you trying to separate each character into an array?

jual.vimaxterpercaya commented: BONEKA FULL BODY ELECTRIC ini terbuat dari bahan pilihan yang lembut, fleksibel dan berkualitas sehingga tidak menimbulkan penyakit dan iritasi pada kulit. UKURAN : panjang : 165cm berat : 4kg BONEKA FULL BODY ELECTRIC dapat di pompa dan di kemas, d +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'Dim OpenAnswerFile As New OpenFileDialog
        Dim strFileName() As String '// String Array.
        Dim tempStr As String = "" '// temp String for result.

        If OpenAnswerFile.ShowDialog = DialogResult.OK Then '// check if OK was pressed.
            strFileName = IO.File.ReadAllLines(OpenAnswerFile.FileName) '// add each line as String Array.
            For Each myLine In strFileName '// loop thru Arrays.
                tempStr &= myLine & vbNewLine '// add Array and new line.
            Next
            MsgBox(tempStr) '// display result.
        End If
codeorder 197 Nearly a Posting Virtuoso
'// Pre-requisites: 3 Labels
        Dim myCoolControls() As Control = {Label1, Label2, Label3}
        '// since Arrays are Index based, Index 0 being Label1, this will change Label2's text.
        myCoolControls(1).Text = "Look, it works!  I like Microsoft afterall."
codeorder 197 Nearly a Posting Virtuoso

A bit confusing to understand, but since an Accept Button is like a Submit button on a Form, pressing the Enter key in any of the fields should press the Submit Button, in this case a PictureBox.

If so, see if the following code sample helps.

'//---------  Pre-requisites: 1 PictureBox, 3 TextBoxes. ---------\\
Public Class Form1

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
        MsgBox("PictureBox Clicked.", MsgBoxStyle.Information)
    End Sub

    '// use one event for multiple controls.
    Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) _
                                Handles TextBox1.KeyUp, TextBox2.KeyUp, TextBox3.KeyUp
        If e.KeyCode = Keys.Enter Then PictureBox1_Click(sender, e) '// call the event procedure.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

how to limit nos. using button for inputting?
VB.NET

nos., like in race cars ???

codeorder 197 Nearly a Posting Virtuoso

This part for FileName "C:/account/myfile.txt", use \ instead of /.
Example: "C:\account\myfile.txt"

As for the rest, see if this helps.

Dim n As String = Environment.NewLine
        Dim MyString As String = TextBox1.Text.PadRight(6) '// add first TextBox text.
        '// add to the same string a new line and the following TextBoxes' text.
        MyString &= n & TextBox2.Text.PadRight(3)
        MyString &= n & TextBox3.Text.PadRight(10)
        MyString &= n & TextBox4.Text.PadRight(6)
        MyString &= n & TextBox5.Text.PadRight(8)
        MyString &= n & TextBox6.Text.PadRight(20)
        MyString &= n & TextBox7.Text.PadRight(25)
        MyString &= n & TextBox8.Text.PadRight(3)
        MyString &= n & TextBox9.Text.PadRight(9)
        MyString &= n & TextBox10.Text.PadRight(35)
        My.Computer.FileSystem.WriteAllText("C:\account\myfile.txt", MyString, False) '// write to file.

Btw, my first few hours of programming in vb.net, I was having trouble adding a TextBox to the Form. :D

codeorder 197 Nearly a Posting Virtuoso

Not sure if this helps, but try converting the Integers to Decimals.
CDec(hoursinteger)

Private Sub calculations()
        If AdultsizeRadioButton1.Checked = True Then
            adulttotaldecimal = quantityinteger * adultpricedecimal * CDec(hoursinteger)

        ElseIf ChildsizeRadioButton2.Checked = True Then
            childtotaldecimal = quantityinteger * childpricedecimal * CDec(hoursinteger)
        End If
        adultchildtotaldecimal = adulttotaldecimal + childtotaldecimal
        extendedpricedecimal = adultchildtotaldecimal * servicetaxdecimal
        accumwagonsrentedinteger += quantityinteger
        accumprofitdecimal += extendedpricedecimal
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Dear...

I opened a NEW PROJECT and The FORM IS BLANK... i done NOTHING... i just COPIED ur CODE and pasted it in NEW PROJECT...

but, It is not working... I don't know why...

it shows 7 errors...

Error 1 End of statement expected. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 3 38 WindowsApplication2

Error 2 End of statement expected. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 4 42 WindowsApplication2

Error 3 End of statement expected. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 5 38 WindowsApplication2

Error 4 End of statement expected. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 6 46 WindowsApplication2

Error 5 Name 'btnNEXT' is not declared. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 46 89 WindowsApplication2

Error 6 Name 'btnNEXT' is not declared. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 73 9 WindowsApplication2

Error 7 Name 'btnNEXT' is not declared. D:\Ariff\WindowsApplication2\WindowsApplication2\Form1.vb 73 38 WindowsApplication2

These are the errors...

Please help me to clear...

Thanks in advance...

Hmmm.
I get only 4 errors COPYING AND PASTING THE CODE YOU RECENTLY POSTED INTO A NEW PROJECT.

I get 32 errors pasting my code in Private Sub Form1_Load(.. of a new Project's code window.

I get no errors IF I FIRST CLEAR ALL CODE IN THE NEW PROJECT'S CODE WINDOW before pasting the code I recently provided in this thread.

And Dear...,
the code was compiled with Visual Studios 2010 Professional that uses a 2.0 .Net Framework.

Overall, no problems running such a simple code in a new project. I can just overlook the code I posted and know that it will run without any errors, …

codeorder 197 Nearly a Posting Virtuoso

View attached images.

Image 1 is as previously posted: Toolbox > Menus & Toolbars > ToolStrip.

Image 2 is clicking the little DropDown Arrow to add Options.
Each Control in that "little DropDown Menu" can be accessed From the Control's Properties Window.

Image 3 is running the Application after I have added a few Buttons with Images to my new Toolbar.

> :)

codeorder 197 Nearly a Posting Virtuoso

OK.
New Project, DO NOT ADD ANY CONTROLS TO THE FORM, LEAVE FORM BLANK, AND PASTE THE CODE ENTIRELY AS I PREVIOUSLY POSTED INTO THE VB.NET CODE WINDOW. Run the Application.

The code creates the first controls, 2 ComboBoxes, 1 TextBox, and a Next Button. Click the Next button to add a new row of similar controls.

codeorder 197 Nearly a Posting Virtuoso

See if the following Start-Up Project helps.

Paste in new Project as is.

Public Class Form1
    '// create Original controls.
    Private cmbCODE1 As New ComboBox With {.Name = "cmbCODE1", .Location = New Point(0, 0), .Size = New Size(121, 21)}
    Private cmbCATEGORY1 As New ComboBox With {.Name = "cmbCATEGORY1", .Location = New Point(125, 0), .Size = New Size(121, 21)}
    Private txtTOTAL1 As New TextBox With {.Name = "txtTOTAL1", .Location = New Point(249, 0), .Size = New Size(75, 21)}
    Private WithEvents btnNEXT As New Button With {.Location = New Point(334, 0), .Size = New Size(75, 21), .Text = "Next"}
    '// lists to populate the ComboBoxes.
    Private lstCODEitems() As String = {"code 1", "code 2", "code 3"}
    Private lstCATEGORYitems() As String = {"category 1", "category 2", "category 3"}
    '// used to name controls for each row, ex: new cmbCODE will be named cmbCODE2, etc.
    Private ctlRow As Integer = 1
    '// used to add controls to a preset Y location since the X location is constant.
    Private ctlRowLocation As Integer = 0

    '// save data to File.
    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Dim myFile As String = Application.StartupPath & "savedData.txt" '// location of file.
        Dim myWriter As New IO.StreamWriter(myFile)

        Dim tempStr As String = "" '// declare new TEMP string.
        For Each ctl As Control In Me.Controls '// loop thru all controls for cmbCODE controls.
            If ctl.Name.StartsWith("cmbCODE") Then tempStr &= "#" & ctl.Text '// add the text values.
        Next
        myWriter.WriteLine(tempStr) '// write to line. …
codeorder 197 Nearly a Posting Virtuoso

Same result as FreaKing , just a different style of coding.

Public Class Form1
    '// Category lists of string arrays.
    '// '-- should be easy to create if you can accesss the database.
    Private lstADIDAS() As String = {"ADIDAS - 1", "ADIDAS - 2", "ADIDAS - 3"}
    Private lstCONVERSE() As String = {"CONVERSE - 1", "CONVERSE - 2", "CONVERSE - 3"}
    Private lstNIKE() As String = {"NIKE - 1", "NIKE - 2", "NIKE - 3", "NIKE - 4", "NIKE - 5", "NIKE - 6", "NIKE - 7", "NIKE - 8", "NIKE - 9"}
    Private lstSKETCHERS() As String = {"SKETCHERS - 1", "SKETCHERS - 2", "SKETCHERS - 3"}

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        If Not ListBox1.SelectedIndex = -1 Then '// check if item is selected. -1 is a No Index.
            ListBox2.Items.Clear() '// clear ListBox2.
            Select Case ListBox1.SelectedItem '// add selections for Categories.
                Case "ADIDAS"
                    For Each myCoolShoe As String In lstADIDAS : ListBox2.Items.Add(myCoolShoe) : Next
                Case "CONVERSE"
                    For Each myCoolShoe As String In lstCONVERSE : ListBox2.Items.Add(myCoolShoe) : Next
                Case "NIKE"
                    For Each myCoolShoe As String In lstNIKE : ListBox2.Items.Add(myCoolShoe) : Next
                Case "SKETCHERS"
                    For Each myCoolShoe As String In lstSKETCHERS : ListBox2.Items.Add(myCoolShoe) : Next
            End Select
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListBox1.Items '// add items to ListBox1.
            .Add("ADIDAS") : .Add("CONVERSE") : .Add("NIKE") : .Add("SKETCHERS")
        End With
    End Sub
End Class

p.s., don't tell anyone, but it pays attention to view the …

codeorder 197 Nearly a Posting Virtuoso

Toolbox > Menus & Toolbars > ToolStrip > :)

codeorder 197 Nearly a Posting Virtuoso

Since this question is probably more ASP.NET related than it is VB.NET, the ASP.NET forum might help a little better.

Although, if your website already has the current number of "users(REGISTERED) are LOGGED-IN CURRENTLY " and you just need to retrieve the information, see if this link helps.

codeorder 197 Nearly a Posting Virtuoso

Not much of a book and not much content, but a good start.
www.codeorder.net/pages/tutorials.html

As for teaching you what you need to know, how are we supposed to know "what you need to know"? :D

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class frmMain

    Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub

    ' allows the TEXT BOXES to accept only numbers, the period, and the Backspace key
    Private Sub txtTest1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _
                                        Handles txtTest1.KeyPress, txtTest2.KeyPress, txtTest3.KeyPress

        If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." _
        AndAlso e.KeyChar <> ControlChars.Back Then
            e.Handled = True
        End If
    End Sub

    '// clear the Label on TextBoxes' TextChanged.
    Private Sub txtTest1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
                                            Handles txtTest1.TextChanged, txtTest2.TextChanged, txtTest3.TextChanged

        lblGrade.Text = String.Empty
    End Sub

    Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
        '// send the TextBoxes values to the function.
        CalculateGrade(txtTest1.Text, txtTest2.Text, txtTest3.Text)
    End Sub

    Private Function CalculateGrade(ByVal testScore1 As Decimal, ByVal testScore2 As Decimal, ByVal testScore3 As Decimal) As String
        Dim myGradeAverage As Decimal = testScore1 + testScore2 + testScore3 '// add grades.
        '// return result.
        If myGradeAverage < 60 Then lblGrade.Text = "F"
        If myGradeAverage >= 60 Then lblGrade.Text = "D"
        If myGradeAverage >= 70 Then lblGrade.Text = "C"
        If myGradeAverage >= 80 Then lblGrade.Text = "B"
        If myGradeAverage >= 90 Then lblGrade.Text = "A"
        Return False
    End Function
End Class

I have added all the TextBoxes to use one event if returning similar code.

Also, the Function could be done a little better to not overwork the "lblGrade", but since you are a student and needs to learn, have fun. :)

codeorder 197 Nearly a Posting Virtuoso

:)
Try this modification.

'//--- THIS FILE WILL BE REMOVED FROM MY WEBSITE ONCE THREAD IS SOLVED ---\\
        Dim linkUrl As String = "http://www.codeorder.net/files/tempTestFile.html" '//-- used for testing only.
        '//--- THE FILE CONTENT IN THE LINK ABOVE IS EXACTLY THE CONTENT PREVIOUSLY POSTED BY "killerbeat" ---\\
        Try
            Dim myResponse As Net.HttpWebResponse = Net.HttpWebRequest.Create(linkUrl).GetResponse '// connect.
            Dim myStream As IO.Stream = myResponse.GetResponseStream() '// get.
            Dim myReader As New IO.StreamReader(myStream) '// read.

            Dim myWebFileInfo As String = myReader.ReadToEnd '// get innerHtml of Page.
            
            '// close reader, information stream, and connection.
            myReader.Close() : myStream.Close() : myResponse.Close()

            '// get location of <pre> by index.
            Dim myStartIndex As Integer = myWebFileInfo.IndexOf("<pre>") + 5 '// add +5 to not add "<pre>" to final result.
            '// get location of </pre> by index.
            Dim myEndIndex As Integer = myWebFileInfo.IndexOf("</pre>")
            '// subtract to get a total number for the substring length result.
            Dim myStringLengthToExtract As Integer = myEndIndex - myStartIndex

            '// extract string.
            myWebFileInfo = myWebFileInfo.Substring(myStartIndex, myStringLengthToExtract)
            '// split into string arrays.
            Dim myHtmlTextLines() As String = myWebFileInfo.Split(vbNewLine.ToCharArray)
            '// display result.
            For Each line As String In myHtmlTextLines '// loop thru each line.
                If Not line.StartsWith(" ") Then '// do not add empty lines.
                    If TextBox1.Lines.Length = 0 Then
                        TextBox1.Text &= line & vbNewLine & vbNewLine '// add an empty line after line 1.
                    Else
                        TextBox1.Text &= line & vbNewLine
                    End If
                End If
            Next
            '// remove HTML formatting.
            With TextBox1 : .Text = .Text.Replace("<b>", "") : .Text = .Text.Replace("</b>", "") : End With

        Catch …
codeorder 197 Nearly a Posting Virtuoso

Use "Exit Sub".

Here is a test sample.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer = 0
        If i = 0 Then
            i += 1
            MsgBox("i = 1")
        End If
        If i = 1 Then
            i += 1
   '//----------------
            Exit Sub
         '----------------\\
        End If
        If i = 2 Then
            MsgBox("i = 2")
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso

How are you adding items to the ListView?

Just add your code to disable the button right after the code of adding the new item. Should work if you start off with ListView.Items.Count = 0.

codeorder 197 Nearly a Posting Virtuoso

You might need this to figure out the C# code posted by sundarchum .

codeorder 197 Nearly a Posting Virtuoso

What Event is your posted code in and are you calling that Event after removing a record?

codeorder 197 Nearly a Posting Virtuoso

Let me know if this helps.

No WebBrowser needed.

'//--- THIS FILE WILL BE REMOVED FROM MY WEBSITE ONCE THREAD IS SOLVED ---\\
        Dim linkUrl As String = "http://www.codeorder.net/files/tempTestFile.html" '//-- used for testing only.
        '//--- THE FILE CONTENT IN THE LINK ABOVE IS EXACTLY THE CONTENT PREVIOUSLY POSTED BY "killerbeat" ---\\
        Try
            Dim myResponse As Net.HttpWebResponse = Net.HttpWebRequest.Create(linkUrl).GetResponse '// connect.
            Dim myStream As IO.Stream = myResponse.GetResponseStream() '// get.
            Dim myReader As New IO.StreamReader(myStream) '// read.

            Dim myWebFileInfo As String = myReader.ReadToEnd '// get innerHtml of Page.

            '// close reader, information stream, and connection.
            myReader.Close() : myStream.Close() : myResponse.Close()

            '// get location of <pre> by index.
            Dim myStartIndex As Integer = myWebFileInfo.IndexOf("<pre>") + 5 '// add +5 to not add "<pre>" to final result.
            '// get location of </pre> by index.
            Dim myEndIndex As Integer = myWebFileInfo.IndexOf("</pre>")
            '// subtract to get a total number for the substring length result.
            Dim myStringLengthToExtract As Integer = myEndIndex - myStartIndex
            '// display result.
            MsgBox(myWebFileInfo.Substring(myStartIndex, myStringLengthToExtract), MsgBoxStyle.Information, "...codeorder...")
        Catch ex As Exception
            MsgBox("Connection Error.", MsgBoxStyle.Critical, "myCool Error Message")
        End Try
codeorder 197 Nearly a Posting Virtuoso

No problem here having a New Project with 2 Forms and using this code.

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Hide()
        Form2.Show()
    End Sub
End Class

Form1 hides and Form2 shows, nothing else.

codeorder 197 Nearly a Posting Virtuoso

Try posting your solution and marking that post as answer.

codeorder 197 Nearly a Posting Virtuoso

First steps would be to create the design and Name your controls properly. Then just getting the correct equation would be the difficult part of the entire project, although probably not difficult at all.

codeorder 197 Nearly a Posting Virtuoso

If possible, attach the scanned image File on your next reply.

I'm scanner-less. :cool:

codeorder 197 Nearly a Posting Virtuoso

Is it possible to post the Html source code from the web-page?

If too much code to add in this thread, send me a private message with the Html source code and bold out or highlight the area of content you want to retrieve.

codeorder 197 Nearly a Posting Virtuoso

I have no problem drawing graphics on a .tif image file by using your code.

Have you tried to save the image as a different format before loading it into your PictureBox and drawing the graphics on it?

codeorder 197 Nearly a Posting Virtuoso

how to check login o x?
thanks

See if this helps.

Public Class Form1
    Private hasLoggedIn As Boolean = False

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Enter Then
            If hasLoggedIn = False Then Button1_Click(sender, e)
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If hasLoggedIn = False Then
            hasLoggedIn = True
            MsgBox("Button1_Click")
        End If
    End Sub

End Class
codeorder 197 Nearly a Posting Virtuoso
  • How are you viewing and getting the innerHtml content of the website, from a vb.net WebBrowser?
  • What do you mean by dynamic, the text is not in the original Html file, but added from something like JavaScript once the page is loaded?
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'// Prerequisites: 3 Buttons
        Dim myCoolControls() As Control = {Button1, Button2, Button3}
        For Each onlyCoolControl As Control In myCoolControls : onlyCoolControl.BackColor = Color.SteelBlue : Next
jdsurgeon commented: I got you dude. +1
codeorder 197 Nearly a Posting Virtuoso

As JJCollins mentioned, a search engine is a good place to find information about vb.net, if you know what to look for.

Also, you can check out my website. It has quite a few tutorials and code samples.
www.codeorder.net

codeorder 197 Nearly a Posting Virtuoso

That "menu" you are referring to, in vb.net is called a ContextMenuStrip.

The ContextMenuStrip can be located in the Toolbox under the "Menus & Toolbars" tab.

Double click the ContextMenuStrip control in the Toolbox and you should get a "ContextMenuStrip" with a "Type Here" right under it on the Form.
That "Type Here" is where you add your options for the context menu, for example Cut, Copy, Paste, etc.

After you add a few options, double click a option you have added and add the appropriate code for that event.

To assign the ContextMenu to Form1, locate the "ContextMenuStrip" option in the Form's Properties and select the ContextMenu you want to use.

You can also assign different ContextMenus for different controls just by following the provided information above.

About your "Secondly,..." question, not my field of coding.

For future references markdean.expres, please limit your thread question to one question, unless it relates.
Good luck with the "Secondly,..." and as DaniWeb says, all the best.

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
        Button1.Enabled = False
    End Sub

    Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        '// code from this thread here.
        '//--- http://www.daniweb.com/forums/post1345601.html#post1345601
    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        If Not TextBox1.Text = "" Then '// check it TextBox1 has any text.
            Button1.Enabled = True '// if so, Enable Button1.
        Else
            Button1.Enabled = False '// otherwise, Disable Button1.
        End If
    End Sub
End Class

Link to thread for KeyPress event.
http://www.daniweb.com/forums/post1345601.html#post1345601