codeorder 197 Nearly a Posting Virtuoso

Personally I have no idea, Not a db.coder; though I would add it right after you first add the DateTimePicker1's.Value(start.date) and before you add the DateTimePicker2's.Value(end.date).
Good luck.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim tsTemp As TimeSpan = DateTimePicker2.Value - DateTimePicker1.Value '// get Date.Time difference.
        Dim iTemp As Integer = 0
        Do Until iTemp = tsTemp.Days '// loop until.Equals the .Days difference.
            iTemp += 1 '// increase.count for next day.
            MsgBox(DateTimePicker1.Value.Date.AddDays(iTemp)) '// get result.
        Loop
    End Sub
codeorder 197 Nearly a Posting Virtuoso

"Code not working"?
.you making fun of me? :D

Since I recently posted to your other thread, hope it clarifies this one.:)
http://www.daniweb.com/software-development/vbnet/threads/408271/1743532#post1743532

codeorder 197 Nearly a Posting Virtuoso

>>Right now i need your help for changing font of datagridview in VB.net 2008
Entirely different question; start a new.thread and mark this one as Solved.
.thanks and welcome to the forum.:)

codeorder 197 Nearly a Posting Virtuoso

Had a chance to play w/this for a few minutes, though I could Not test.

Public Class Form1
    Private isSendingPMSxD As Boolean = False '// alert wb that it is a p.m. page.
    Private iStartID, iEndID As Integer

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.ScriptErrorsSuppressed = True '// disable Error.Messages.
    End Sub

    Private Sub showCoolMessage(ByVal selCoolMessage As String, ByVal selCoolTitle As String) '// just.because.
        MessageBox.Show("Please enter " & selCoolMessage, selCoolTitle & " Required", MessageBoxButtons.OK, MessageBoxIcon.Error)
    End Sub

    Private Sub _Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        With TextBox3 : If .Text = "" Then : showCoolMessage("a subject", "Subject") : Exit Sub : End If : End With
        With TextBox4 : If .Text = "" Then : showCoolMessage("a message", "Message") : Exit Sub : End If : End With
        With TextBox5
            If .Text = "" OrElse Not IsNumeric(CInt(.Text)) Then : showCoolMessage("start ID to PM", "Start ID") : Exit Sub
            Else
                iStartID = CInt(.Text)
            End If
        End With
        With TextBox6
            If TextBox6.Text = "" OrElse Not IsNumeric(CInt(.Text)) Then : showCoolMessage("end ID to PM", "End ID") : Exit Sub
            Else
                iEndID = CInt(.Text)
            End If
            : End With
        isSendingPMSxD = True
        wbNavigate(iStartID)
        Button3.Enabled = False
    End Sub

    Private Sub wbNavigate(ByVal selCoolIDtoUse As Integer)
        WebBrowser1.Navigate("http://forum.ea.com/uk/pm/sendTo/" & selCoolIDtoUse & ".page")
    End Sub

    Private Sub _WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        If isSendingPMSxD Then
            With WebBrowser1.Document
                .GetElementById("subject").SetAttribute("value", TextBox3.Text)
                .GetElementById("message").SetAttribute("value", TextBox4.Text)
                .GetElementById("btnSubmit").InvokeMember("click")
                Label4.Text = iStartID
                Application.DoEvents()
                If Not iStartID = iEndID …
codeorder 197 Nearly a Posting Virtuoso

If A=#1 Then I have to drop the B-Bomb and lighten my day.:D

codeorder 197 Nearly a Posting Virtuoso

Don't bother to hate, hate to bother.:D

codeorder 197 Nearly a Posting Virtuoso

.suggestion: Take a look into adding a WindowsMediaPlayer to the Form and just add controls on top of it.

codeorder 197 Nearly a Posting Virtuoso

Reverend Jim, I completely agree since I also created an automated p.m.s'er:D to send p.m.s:D to those that did not mark their threads Solved or just abandoned their threads, and it did use the _wb_DocumentCompleted event.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim fileName As String = FileUpload1.PostedFile.FileName
        Dim fileServer As String = FileUpload1.FileName

        If FileUpload1.HasFile Then
            ' some code here
            '//////////////////////////////////////////////////
            If isCoolExcelFile(fileName) Then
                '//////////////////////////////////////////////////
                'some code here
            Else
                'some code here
            End If
        Else '// If FileUpload1.Has "NO" File
            'some code here
        End If
    End Sub

    Private Function isCoolExcelFile(ByVal selCoolFile As String) As Boolean
        Select Case IO.Path.GetExtension(selCoolFile)
            Case ".xls"
                Return True
            Case Else
                Return False
        End Select
    End Function
codeorder 197 Nearly a Posting Virtuoso

A goo"g<>d"iggle has it's ow"w<>n"orth.

codeorder 197 Nearly a Posting Virtuoso

Just taking a wild guess here; I think that this might be the cause of the issue.

While WebBrowser1.ReadyState <> WebBrowserReadyState.Complete
                Application.DoEvents()
            End While

Try commenting out the Application.DoEvents() and report back.

The WebBrowser1.ScriptErrorsSuppressed = True can be set "only once" in Form1_Load and it will take care of all Script.Error Messages andOr can be set in the wb(WebBrowser)'s Properties.

codeorder 197 Nearly a Posting Virtuoso

See if this helps to get you started.
1.Button

Imports System.IO
Public Class Form1

#Region "-----===-----===-----===-----===-----=== Log chopping crap xD ===-----===-----===-----===-----===-----"
    Public myFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\user.log activity\" '// Folder for File(s).
    Private myLogFile As String = myFolder & "myCoolLogFile.txt" '// your.File.
    '// easier to write and understand File.
    Private sLogIn As String = "Logged in: ", sLogOut As String = "Logged out: ", sUpdateData As String = "Updated Data: "

    Public Sub xSaveCoolLogFile(ByVal selCoolFile As String, ByVal selCoolContent As String)
        If File.Exists(selCoolFile) Then
            File.WriteAllText(selCoolFile, selCoolContent & vbNewLine & File.ReadAllText(selCoolFile))
        Else
            File.WriteAllText(selCoolFile, selCoolContent)
        End If
    End Sub
#End Region

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        xSaveCoolLogFile(myLogFile, sLogOut & DateTime.Now)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Directory.Exists(myFolder) Then Directory.CreateDirectory(myFolder) '// create Folder if Not .Exists.
        xSaveCoolLogFile(myLogFile, sLogIn & DateTime.Now)
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sTemp As String = "some data to update to ""whatever/wherever"""
        MsgBox(sTemp) '// code here to update/edit/etc. data.
        xSaveCoolLogFile(myLogFile, sUpdateData & DateTime.Now & " - " & sTemp)
    End Sub
End Class

It uses a File, Not a db(database) and it's quite simple to get you on the road to success.:D

If you do end up using a File to save the user's activity, I would create a new file every week/month, depending on how often a user might use your app..

codeorder 197 Nearly a Posting Virtuoso

...and these 2 words, lost me again.:D

dij_0983 commented: I'm not gonna post again as long as I see the words lost and again in the next posts ;) +0
codeorder 197 Nearly a Posting Virtuoso

Pgmer, something else other than glad I could help.
.You can use more than one "something" in a Select Case(line.2).

Select Case fileExtenstion
                Case ".xlt",".xls"
                    Return True                
                Case Else
                    Return False
            End Select

jbutardo, I already flagged your thread as an ASP.NET thread, though I will try to help once you provide more defined details as to exactly "how" to make it more of a "clean code" other than having one too many declarations.

codeorder 197 Nearly a Posting Virtuoso

Pgmer, why Not use IO.Path.GetExtension("full File.Path or just File.Name here") ?

codeorder 197 Nearly a Posting Virtuoso
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With New OpenFileDialog
            .Filter = "Only myCool Excel Files|*.xls;*.xlst"
            If .ShowDialog = Windows.Forms.DialogResult.OK Then
                MsgBox("tada")
            End If
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

I have not bothered with

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

, thus I have no idea regarding it.
I do however have an idea of my own.
.Why Not delete the File and Then .Move the File to the deleted File's location, instead of over.writing it?

codeorder 197 Nearly a Posting Virtuoso

For these few words are lost again. :D

codeorder 197 Nearly a Posting Virtuoso

april_004, start your own thread and send me a link via a p.m.; will see what I can do Then.
ng5, my.apologies for this post.

codeorder 197 Nearly a Posting Virtuoso

Forever isNot eternity and eternity does Not last forever.

codeorder 197 Nearly a Posting Virtuoso

As previously mentioned, not a db.coder here, thus I'll edit w/no radar(my vb.net):D.

Dim sCoolNewLine As String = "~"
        con.Open()
        cmd = New SqlCommand("INSERT INTO SampleTbl VALUES('" & TextBox1.Text.Replace(vbNewLine, sCoolNewLine) & "'", con)
        cmd.ExecuteNonQuery()
        con.Close()

This TextBox1.Text.Replace(vbNewLine, sCoolNewLine) will replace line.breaks from a TextBox, w/a char("~") and should be done when updating your db(database).

To undo this, when retrieving info from db, reverse the .Replace process to TextBox1.Text.Replace(sCoolNewLine, vbNewLine) and you should get your line.breaks as previously were, in TextBox.

The char ("~") should be blocked from being typed by a user, to not confuse the way your code updates/retrieves data to/from db.

I used a String in my previously posted code, though you can always use just a char as "~" or "^", or even ".etc.". Reason for String; Not likely it will ever be typed by a user as ".:.myCooLvbNewLine.:." , thus no issues.

Hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso

How far does one have to go to get nowhere?

codeorder 197 Nearly a Posting Virtuoso

I just overlooked the last post of this thread and wanted to provide some code.clean up assistance. Hope it helps.:)

Imports System.IO
Public Class Form1
    Private myStrings(0 To 4) As String
    Private ofd As New OpenFileDialog, sfd As New SaveFileDialog

    Private Sub _Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If ofd.ShowDialog = DialogResult.OK Then
            myStrings = File.ReadAllLines(ofd.FileName)
            TextBox1.Lines = myStrings
        End If
    End Sub

    Private Sub _Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If sfd.ShowDialog = DialogResult.OK Then
            Try
                myStrings = TextBox1.Lines
                File.WriteAllLines(sfd.FileName, myStrings)
                Exit Sub
            Catch ex As Exception
                MsgBox("Woops. There was a problem saving.")
            End Try
        End If
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Button1.Text = ".save" : Button2.Text = ".load"
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Since I'm Not a db.coder, I do not know of any other way to pursue this other than:

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With TextBox1 : .Text = replaceNewLine(.Text, True) : End With '// replace line.break w/String.
    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        With TextBox1 : .Text = replaceNewLine(.Text, False) : End With '// replace String with line.break.
    End Sub

    Private Function replaceNewLine(ByVal selContent As String, ByVal isReplacingNewLineWithChar As Boolean, _
                                    Optional ByVal selNewLineStringToUse As String = ".:.myCooLvbNewLine.:.") As String
        If isReplacingNewLineWithChar Then : Return selContent.Replace(vbNewLine, selNewLineStringToUse)
        Else : Return selContent.Replace(selNewLineStringToUse, vbNewLine)
        End If
    End Function
End Class

Basically, replace each line.break w/a char. or a string that will not be found or likely used in your db.items, save to db and un.replace?:D the line.break string when loading items from the db.

codeorder 197 Nearly a Posting Virtuoso

I have had the same issue years ago and could not figure it out.:(Thanks for solution.:)

codeorder 197 Nearly a Posting Virtuoso

I am also quite unclear on your question; thus If you would like my further support for this.thread, do supply the neccessary and well defined.details. Otherwise, I will take leave and fly on my own w/out a radar, as always:).

codeorder 197 Nearly a Posting Virtuoso

..., lost again, in sands of time.

codeorder 197 Nearly a Posting Virtuoso

.even If thread.solved, hope this helps.

Imports System.IO
Public Class Form1
    Private myCoolFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\test.txt"
    '// save.
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        File.WriteAllText(myCoolFile, "your content here")
    End Sub
End Class

For every type of saving, I never bothered much w/the: StreamWriter and started using: WriteAllText .
Even when it comes to Appending.lines to a File, I load the file, add my.content Then add the previous File's content, save the file with the simple code I just posted, and it Appends to the top of the File, Not bottom.

Regarding saving more than one String to a File, using the save.code, I use a simple String or 2 to help me along the way.

Imports System.IO
Public Class Form1
    Private myCoolFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\test.txt"
    Private sTCoolString As String, xnL As String = vbNewLine
    '// save.
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        sTCoolString = "" '// .clear for new input.
        For i As Integer = 0 To 9 '// For testing saving lines to file.
            If Not sTCoolString = "" Then sTCoolString &= xnL & i Else sTCoolString = i
        Next
        sTCoolString &= xnL & "done.saving"
        File.WriteAllText(myCoolFile, sTCoolString)
    End Sub
End Class

This is quite simple, it does not require any True/False, and it returns the same results.

codeorder 197 Nearly a Posting Virtuoso

I claimed that I voted down the queen. Yep, tiny ol' .Me.:D

Check out her rep.points:www.daniweb.com/members/cscgal/1#infractions
.Might make it easier to understand, though I never got a dam.n red.light bulb.:(
.Might try again next x.mas.:D

codeorder 197 Nearly a Posting Virtuoso

...with a broken watch I count time.

>>dude are we the only ones playing this word game?
Dude!!!, I don't know.:D

codeorder 197 Nearly a Posting Virtuoso

..for on Earth there is a day and night, and it's about to put this story to sleep and begin a new day. :)

New horizons, clear skies, and beer.
:D

codeorder 197 Nearly a Posting Virtuoso

Saving to .xml is just as saving to .txt, just more modern.

If you really want to keep your password.secure, encrypt/decrypt it.
Here's something simple for vb.noobs:http://www.daniweb.com/software-development/vbnet/threads/375789

Since I have Not had much use for vb.net and passwords, I can only presumme that saving the password to the Registry, after encrypting, would be the most secure way to do, for a vb.noob.

codeorder 197 Nearly a Posting Virtuoso

Eagerly, Not waiting.:D
btw, hope you enjoyed your vacation and that you were only thinking about the pussy.cat and vb.net.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.
.you will need a Form3 w/a TextBox on it.

Imports System.IO
Public Class Form1
    Private myPasswordFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\myPasswordFile.txt"
    Private sPassword As String = Nothing '// string to hold your password.

    Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        File.WriteAllText(myPasswordFile, sPassword) '// save.Password to File.
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        If File.Exists(myPasswordFile) Then
            sPassword = File.ReadAllText(myPasswordFile) '// load password.
        Else
            sPassword = "!@(*&^$*()%$%_)(*^&*(" '// set a dummy.Password If no pre.saved password.
        End If
    End Sub

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

    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        Select Case TextBox1.Text
            Case sPassword, "top.secret"
                Form2.ShowDialog()
            Case "replace"
                With Form3
                    .ShowDialog()
                    sPassword = .TextBox1.Text
                    MsgBox("Password Replaced")
                End With
            Case Else
                    MsgBox("Invalid Password", MsgBoxStyle.OkOnly, "Ok")
        End Select
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

>>i dont know whats going on... ??
Me.either!!!:(

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

See if this helps.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With New Form3 '// Child.Form
            .MdiParent = Me '// Parent.Form
            .Show() '// get.results.:)
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Without a bud's light, I may be left in the dark forever; for I am lighter.less.

codeorder 197 Nearly a Posting Virtuoso

Yo, ?tf did I just reply again?(thinking,...,hmm, ?tf Not?

codeorder 197 Nearly a Posting Virtuoso

Hi jingda. Long time it seems like since last contact. Now I know why.:)
>>...down-grading the Queen
?tf(why.the.f.ck) Not?

codeorder 197 Nearly a Posting Virtuoso

See If this helps.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        MsgBox(xDate)
        MsgBox(xDate("dd"))
    End Sub
    Private Function xDate(Optional ByVal selDateFormat As String = "MM.dd.yyyy") As String
        Return Date.Now.ToString(selDateFormat)
    End Function
codeorder 197 Nearly a Posting Virtuoso

Yogi was a smart yoda since last I talked to him, he said something as "...for bright is beauty.foo'..".

codeorder 197 Nearly a Posting Virtuoso

.k., started working on this:
1.TextBox,1.Label,1.ContextMenuStrip(toolbox:Menus & sh.t:)

Public Class Form1
    Private myEmailAddresses() As String = {"abc@daniweb.com", "abc.again@daniweb.com", "bcd@daniweb.com", "bcd.again@daniweb.com"}
    Private chrEmailSeparator As Char = ";"
    Private WithEvents tmrCM As New Timer With {.Interval = 500, .Enabled = True}

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        With ContextMenuStrip1
            '.dropdown()
        End With
    End Sub

    Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown, ContextMenuStrip1.KeyDown
        Select Case e.KeyCode
            Case Keys.Down
                With ContextMenuStrip1
                    If Not .Items.Count = 0 Then
                        .Select() : .Focus()
                        Dim iItemIndex As Integer = -1, sItemText As String = .GetItemAt(.DisplayRectangle.X, .DisplayRectangle.Y).Text
                        'For Each itm As ToolStripItem In .Items
                        '    If itm.Text = sItemText Then
                        '        iItemIndex += 1
                        '        Exit For
                        '    End If
                        'Next
                        TextBox1.Text = sItemText : .Select() : .Focus()
                    End If
                End With
        End Select

    End Sub

    Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
        loadCoolAutoComplete(myEmailAddresses, TextBox1, ContextMenuStrip1)
    End Sub

    'Private isReloaded As Boolean = True
    Private Sub loadCoolAutoComplete(ByVal selEmailsCoolArray As Array, ByVal selCoolTextBox As TextBox, ByVal selContextMenu As ContextMenuStrip)
        With selContextMenu
            .Items.Clear()
            Dim txtIndex As Integer = selCoolTextBox.GetLineFromCharIndex(selCoolTextBox.SelectionStart) - selCoolTextBox.GetFirstCharIndexFromLine(selCoolTextBox.GetLineFromCharIndex(selCoolTextBox.SelectionStart))
            For Each itm As String In selEmailsCoolArray
                If itm.StartsWith(selCoolTextBox.Text) Then .Items.Add(itm)
            Next
            'Dim sItemText As String = .GetItemAt(.DisplayRectangle.X, .DisplayRectangle.Y).Text
            'TextBox1.Text = sItemText : .Select() : .Focus()

            selCoolTextBox.Select(selCoolTextBox.TextLength, 0)
            '   If Not .Items.Count = 0 Then .Items(0).Select()
            '  selCoolTextBox.Text = .GetItemAt(.DisplayRectangle.X, .DisplayRectangle.Y).Text
            '  selCoolTextBox.Select(txtIndex, selCoolTextBox.TextLength - txtIndex)
            If Not selCoolTextBox.Text = Nothing Then 'andalso Not selCoolTextBox .Text .Contains ( Then
                .AutoClose = False
                .Show(Me, selCoolTextBox.Location.X, selCoolTextBox.Location.Y + selCoolTextBox.Height)
                If Not …
codeorder 197 Nearly a Posting Virtuoso

2.Buttons,1.ListBox,new.Project

Imports System.IO
Public Class Form1
#Region "-----===-----===-----=== DECLARATIONS ÆND STUFF ===-----===-----===-----"

    Private btnUp, btnDown As Button, lbMain As ListBox '// If you need control, you make your own.
    Private iT, iM As Integer, sT As String '// TEMP sh.t.
#End Region '===-----===-----===-----'

#Region "-----===-----===-----=== START.UP ÆND SH.T===-----===-----===-----"

    Private Sub loadMyCoolApp()
        Me.Font = New Font("verdana", 10, FontStyle.Bold) '// just.because.
        btnUp = Button1 : With btnUp : .Text = "^" : .Cursor = Cursors.Hand : End With '// take control of code.
        btnDown = Button2 : With btnDown : .Text = "v" : .Cursor = Cursors.Hand : End With '// loose control of code. xD
        lbMain = ListBox1 : With lbMain.Items : .Add("Guava") : .Add("Apple") : .Add("Pineapple") '// set.load ListBox.
            If Not .Count = 0 Then lbMain.SelectedIndex = 0 Else toogleUpDown()
        End With
    End Sub
    Private Sub toogleUpDown()
        iT = lbMain.SelectedIndex : btnUp.Enabled = False : btnDown.Enabled = False '// lights.off.
        If Not iT = -1 Then '// if item selected Then lights.on.
            If iT > 0 Then btnUp.Enabled = True
            If iT < lbMain.Items.Count - 1 Then btnDown.Enabled = True
        End If
    End Sub
    Private Sub relocateItems(ByVal selBtn As Button)
        With lbMain
            sT = .SelectedItem '// get.Item Value.
            iM = .SelectedIndex  '// get.Item Index and some.
            .Items.Remove(.SelectedItem) '// .Remove.Item.
            If selBtn Is btnUp Then .Items.Insert(iM - 1, sT) '// .insert.Item. why -1?, cause it worx.xD
            If selBtn Is btnDown Then .Items.Insert(iM + 1, sT) '// .insert.Item. why +1?, cause it worx.xD
            .SelectedItem = sT '// highlight item again.
            Exit …
codeorder 197 Nearly a Posting Virtuoso

>>Got it?
.will try to get it.Then reply.:)

codeorder 197 Nearly a Posting Virtuoso

Cloudy and yet quite clear, I become a day in my life.

codeorder 197 Nearly a Posting Virtuoso

>>Why did you down-vote her?
Why Not?
Only way to know your status in a queen's kingdom is to test out your skill and if not dead already, Then you must be worth something.:D

In reality: Since when you down.vote someone, it gives them a little "red" looking light.bulb, instead of a green one; at least for most of the time.

I was trying to get some Christmas colors in her list:D, and had no luck, got a "gray" light.bulb instead of a "red" one.:(
--------
>.vb.net ? Is it really still used?
Quite a bit and it's still holding strong, If Not stronger.:)

codeorder 197 Nearly a Posting Virtuoso

>>in the above code 34th line i am geting a error like "Index was outside the bounds of the array."
Have you tried the previously posted.code in a New Project w/only 6.Buttons? If Not, give that a Try, should Not error.

codeorder 197 Nearly a Posting Virtuoso

See if this helps to load a file by clicking a Button.

Imports System.IO
Public Class Form1
#Region "-----===-----===-----=== DECLARATIONS ===-----===-----===-----"
    Private myCoolFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\myCoolBtnTextFile.txt" '// your.File to .Save/.Load to/from.
    Private chrMain As Char = "|" '// char used to .Split each line into 2, for .Name and for .Tag of each btn.
#End Region '===-----===-----===-----'


    Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        LoadOrSaveBtnsOptions(True) '// Save.File.
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        LoadOrSaveBtnsOptions() '// Load.File If available.
    End Sub

#Region "-----===-----===-----=== BTNS OPTIONS ===-----===-----===-----"

    Private Sub LoadOrSaveBtnsOptions(Optional ByVal isSaving As Boolean = False)
        '/////////////////////////////////////////////////    YOUR BUTTONS    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
        Dim btnArray() As Button = {Button1, Button2, Button3, Button4, Button5, Button6}
        '/////////////////////////////////////////////////                              \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
        Dim sContent As String = "" : Dim arFileLines() As String = Nothing '// read.File if it.Exists.
        If Not isSaving Then If File.Exists(myCoolFile) Then arFileLines = File.ReadAllLines(myCoolFile)
        For i As Integer = 0 To btnArray.Length - 1 '// loop thru each btn in btn.Array.
            With btnArray(i)
                If Not isSaving Then '// check if it should Save of Not.
                    '// add Event.Handlers to each btn.
                    AddHandler .MouseDown, AddressOf _btnsOptions_MouseDown '// allows right click of .
                    AddHandler .Click, AddressOf _btnsOptions_Click '// executes tag.process of .
                    .Cursor = Cursors.Hand '// cute.Hand cursor. xD
                    If Not btnArray.Length = 0 Then '// check If File has been loaded.
                        '// set .Text and .Tag by .Splitting the line into Arrays.
                        .Text = arFileLines(i).Split(chrMain).GetValue(1) : .Tag = arFileLines(i).Split(chrMain).GetValue(2)
                    End If
                    Continue For '// …