codeorder 197 Nearly a Posting Virtuoso

>>can i add the sum total of the column in the footer of listview?
If "footer" is the "header" Or "ColumnHeader", then see if this helps.

With ListView1
            .Columns(0).Text = "ListView1" '// Column1
            .Columns(1).Text = ".Count" '// Column2
        End With
codeorder 197 Nearly a Posting Virtuoso

>>Guys I'm overwhelmed of this code you have given to me. Is there no other simpler codes out there? But anyway, thank you.
.See if this helps.
http://www.daniweb.com/software-development/vbnet/threads/348154/1478546#post1478546

codeorder 197 Nearly a Posting Virtuoso

Mitja Bonca, what exactly is the code you posted supposed to do other than error?

bukk123, see if this helps as well.

With ComboBox1
            If Not .SelectedIndex = -1 Then '// if item selected, since -1 ='s No item selected.
                With .SelectedItem.ToString.Split(" "c) '// .Split by " " and...
                    TextBox1.Text = .GetValue(0).ToString  '// get the first value.
                    TextBox2.Text = .GetValue(1).ToString '// get the second value.
                End With
            End If
        End With
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

Just reinstalled my o.s., flied w/out a vb.radar for a few hours:D, though glad that your current programming issue is "Solved" AndAlso glad that I was able to still provide.support.:)

codeorder 197 Nearly a Posting Virtuoso

From the code posted and the link to get a ListBox loaded w/the sub.directories, I think that, sec...

Might help if you create a new Directory andThen .Move.File.over.

...into that New.Directory.

.my.apologies "vb.noob":D, I left some info out.:)

codeorder 197 Nearly a Posting Virtuoso

q.q.(quick.question)
.what exactly are you trying to do? GetFolderName And Then what???
If it is to create the Directory and place the File in it, see if this helps.

Public Sub xNewCoolFolder(ByVal selCoolFolder As String)
        If Not Directory.Exists(selCoolFolder) Then Directory.CreateDirectory(selCoolFolder)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        xNewCoolFolder(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\myCoolFolder")
    End Sub

Might help if you create a new Directory andThen .Move.File.over.

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

Add this just below line 11.

'/////////////////
                With Path.GetDirectoryName(subdir)
                    MsgBox(.Substring(.LastIndexOf("\") + 1)) '// getFolderName only. :)
                    '//////
                    End '// TERMINATE APPLICATION (FOR TESTING)
                End With
                '/////////////////
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

:)
>>Ideas on how to fix that?
See if this helps to get a list of sub.directories in a .directory.
http://www.daniweb.com/software-development/vbnet/threads/389881/1679636#post1679636

codeorder 197 Nearly a Posting Virtuoso

Updated code from your other thread.
1 Button, 1 ProgressBar

Imports System.IO
Public Class Form1
    Private sTemp1, sTemp2 As String '// TEMP.Strings, used as needed.

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

    Private Sub copyDirectory(ByVal selCoolSourcePath As String, ByVal selDestinationPath As String, Optional selCoolFileExtension As String = "*.*", Optional selCoolProgressBar As ProgressBar = Nothing)
        sTemp1 = ""
        With selCoolProgressBar
            If Not selCoolProgressBar Is Nothing Then '// if ProgressBar sent, set .Value and .Maximum.
                .Value = 0
                .Maximum = Directory.GetFiles(selCoolSourcePath, selCoolFileExtension, IO.SearchOption.AllDirectories).Length
            End If
            If Not Directory.Exists(selDestinationPath) Then Directory.CreateDirectory(selDestinationPath) '// create Folder if needed.
            For Each myCoolFile As String In My.Computer.FileSystem.GetFiles _
                                                     (selCoolSourcePath, FileIO.SearchOption.SearchAllSubDirectories, selCoolFileExtension) '// loop thru Source.Files.
                sTemp1 = selDestinationPath & "\" & Path.GetFileName(myCoolFile) '// set .DestinationPath w/only the filename+extension.
                If Not File.Exists(sTemp1) Then '// if .File Not.Exist, procced, Else it will error "for.now".
                    File.Copy(myCoolFile, sTemp1) '// copy File.over.
                Else
                    ' MsgBox("File.Exists in Destination.Folder, cannot copy." & vbNewLine & sTemp1, MsgBoxStyle.Information)
                End If
                If Not selCoolProgressBar Is Nothing Then .Value += 1 '// +=1 .Value, if ProgressBar sent.
            Next …
codeorder 197 Nearly a Posting Virtuoso

I helped someone w/a "pig.latin" thread a while ago. Hope it helps. :)
http://www.daniweb.com/software-development/vbnet/threads/347345

codeorder 197 Nearly a Posting Virtuoso

See if this thread.reply of mine helps. :)

codeorder 197 Nearly a Posting Virtuoso

:)

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

>>how should i insert into the mysql database so that it will exist for the next execution and exist in my database?
That is an entirely new question and since I'm Not a db(database) coder, I have no idea on how exactly someone would save and load items from mySql. Before starting a new thread, try searching this forum first.

AndAlso, glad I could help.:)

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
Me.ComboBox1.Items.Add("Form1")
Form2.ComboBox1.Items.Add("Form1")
codeorder 197 Nearly a Posting Virtuoso

Why not store the items of each ComboBox into an ArrayList and .Close the Form if no use for it?

codeorder 197 Nearly a Posting Virtuoso

>>Hi RenanLazarotto, what do you do to when you close form but with-out lost data.
Use Me.Hide and Not Me.Close .

codeorder 197 Nearly a Posting Virtuoso

>>Or should I just use your copy directory script as a function and go the long way listing folder by folder by folder?
.w/the code I posted, you should be able to add file.countBySelCoolFileExtension(".vb",".etc") /overwrite.file methods/and whatever else your little heart desires.:D
.hope it helped more than just copying a directory.over. :)

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

See if this helps.

Public Class Form1
    Private WithEvents myCoolTimer1 As New Timer With {.Interval = 100, .Enabled = True}

    Private Sub Form1_KeyUp(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
        If e.KeyCode = Keys.Escape Then Me.Close() '// .Close app. on ESC key.
    End Sub

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        With Me
            .KeyPreview = True '// for ESC key.
            .Opacity = 0 '// make transparent.
            .ShowInTaskbar = False
        End With
    End Sub

    Private Sub myCoolTimer1_Tick(sender As Object, e As System.EventArgs) Handles myCoolTimer1.Tick
        With Me
            If Not .Focused Then .Activate() '// keep app. constantly focused.
        End With
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso
For Each ctl In New TextBox() {TextBox1, TextBox2, TextBox3}
            ctl.Clear()
        Next
codeorder 197 Nearly a Posting Virtuoso

If thread=solved Then mark as Solved AndAlso Return "Thanks" & :)

codeorder 197 Nearly a Posting Virtuoso
If lstInvisibleTv.Items.Count = lstInvisiblePc.Items.Count +1 Then

:)

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

>>i thought 'Application.StartupPath' was a command for stating the path of the folder.
Hobbyist programmer here, though I think that "My.Resources" gets built into the .exe, and is not an external folder; could be wrong though, long day in the sun around drunks for Octoberfest, should be Octobeerfest:D, though overall, thanx for clearing up the issue and marking the thread as Solved.:) (+=glad.i.could help:))

codeorder 197 Nearly a Posting Virtuoso

q.q.(quick question)
Is the file in My.Resources or is it in the Application.StartupPath folder?

codeorder 197 Nearly a Posting Virtuoso

My.Resources, nice choice.
You do have to read the file from the My.Resources just as you have to read it from a folder.
Hope this helps.:)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim myCoolFolder As String = Application.StartupPath & "\"
        Dim myCoolQuestionsAndAnswersFile As String = myCoolFolder & "QandA.txt" '// your File.
        Process.Start(myCoolFolder) '// load Folder.
        '// place file in this Folder while Debugging and place File in same Folder as your app. when installing.
codeorder 197 Nearly a Posting Virtuoso

If it's web based, my referenced solution is that you will have to create a .css and possibly some .js(JavaScript) code to have it all work with vb.net.

Check out this post for help regarding to add content to a WebBrowser.
http://www.daniweb.com/software-development/vbnet/threads/380137/1638656#post1638656

You will need some code as this also:

http://javascript.internet.com/css/drag-and-drop.html

.The above link's code does not work in FireFox, though it should be similar to what you will need for your projects.

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

...and crush the will to protect life.

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

Is this for a windows.application or a web.based application?
If windows.based, see if this helps.
http://www.daniweb.com/software-development/vbnet/threads/345710/1468687#post1468687

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

Very good suggestion, especially with that ParamArray (:news.to.me:)

The only issue with using a Sub, is that I cannot really control all of the Properties as I can with a "With" statement.
ex:

With lvMain
            .Items.Add(New ListViewItem("item.1,subItem".Split(",")))
            .BackColor = Color.LightSteelBlue
            .Font = New Font("Verdana", 10, FontStyle.Bold)
            '.etc...
        End With

I would have to create a Sub for each Property and that can be...

In any case, I sent a p.m. to a daniweb.friend and he replied with this:

Thats just not going to happen. I messed around with it for a while but couldn't come up with much.

Teme64's idea of the sub with the ParamArray is probably the best.

I did come up with this that can do it in 3 lines but with no with.

For Each Item In New ProgressBar() {ProgressBar1, ProgressBar2}
      Item.Value = 45
Next

Like I said the with is just not going to happen.

Unhnd_Exception's solution is probably the best solution since I can actually use 3 lines of code and control more than one control's Properties.

Thanks everyone, thread solved.:)

codeorder 197 Nearly a Posting Virtuoso

Something as that With Each ProgressBar , although I would like to create something as the With statement and be able to control more than one ProgressBar just by adding another ProgressBar to the wit of the "With". With bulbPrgSave1, bulbPrgSave2, bulbPrgSave3, bulbPrgSaveEtc...

codeorder 197 Nearly a Posting Virtuoso
With bulbPrgSave1, bulbPrgSave2
            .Value = 50
        End Wit

What would I need to create something as the above and set values to 2+ ProgressBars? A Structure? Property?

codeorder 197 Nearly a Posting Virtuoso