codeorder 197 Nearly a Posting Virtuoso

I'm still done with this thread.:D
Glad I could help.:)

codeorder 197 Nearly a Posting Virtuoso

Try my previous code in a new project.
Leave Form1's .Name as is and add a new form named "frmLogin".
Don't forget about the app.s properties of "When last form closes".

Let me know how that goes, and if still Nothing, I am still done with this thread. Good luck.

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
        With ProgressBar1
            .Maximum = 100
        End With
        With Timer1
            .Interval = 500 '// 1/2 sec. delay.
            Me.Show() '// display Form before starting Timer.
            .Start() '// start Timer.
        End With
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static iCount As Integer = 0
        If Not iCount = 10 Then
            iCount += 1
            ProgressBar1.Value += 10
        Else
            frmLogin.Show()
            Me.Close() '// stops the Timer as well.
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Post your "imitating" Form's code.

codeorder 197 Nearly a Posting Virtuoso
codeorder 197 Nearly a Posting Virtuoso
If i > 10 Then
            Nextform.Show()
            Timer1.Stop()
            Me.Close '// Close current Form.
        End If
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim x As String = "some message"
        MsgBox(x) '// original String.
        x = StrReverse(x)
        MsgBox(x) '// reversed String.
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.Alt AndAlso e.KeyCode = Keys.C Then MsgBox("tada")
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.KeyPreview = True '// keep focus of Keys on Form.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

q.q.(quick question)
Do you only need to kill.processes if your app. is active or can it run in the background and kill.processes if certain keys are pressed?

codeorder 197 Nearly a Posting Virtuoso

You will also need to have your app. know what to do with the file once it is assigned to load it.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each arg As String In My.Application.CommandLineArgs
            MsgBox(arg) '// get full path of file.
            '// do what you want with file afterward.
        Next
    End Sub
End Class

To test this quickly, build your app., create a file with any type of file.extension, right click the file and select "Open" or "Open With".
Locate your recently build app. and select it. A MsgBox should appear with the file's full path. Afterward, that assigned file extension, if selected to always use that program to load it, should have your app.'s icon on it and double clicking it should automatically load it in your app..

Hope this helps.

codeorder 197 Nearly a Posting Virtuoso

>>...play a sound that is in your Resource folder
http://www.daniweb.com/software-development/vbnet/threads/46514

codeorder 197 Nearly a Posting Virtuoso

Works here just fine.
Try explaining the issue and not just saying sh.t don't work.

Just wondering, is it changing all #'s in the entire TextBox and you only need to change the #'s on the lines that .Contains("|")?
AndAlso, change only the first 3 #'s before the "|" and the 3 #'s after?

Hope this helps to solve your issue, although it should have been info provided by you already.

p.s. Welcome to an "IT" forum.:)

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
        With TextBox1
            .Text = "123|456" '// FOR TESTING.
            For Each c As Char In .Text '// loop thru all char.s.
                If Char.IsDigit(c) Then .Text = .Text.Replace(c, "*") '// .Replace char. with your char..
            Next
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Since "arTemp" is already declared in my previous code, use this.

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        With ListBox1
            If Not .SelectedIndex = -1 Then
                arTemp = .Items(.SelectedIndex).ToString.Split(":"c) '// .Split item in 2 Arrays.
                MsgBox(arTemp(0)) '// IP.
                MsgBox(arTemp(1)) '// Port.
            End If
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Button, 1 ListBox

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        getHTML("http://hidemyass.com/proxy-list/")
    End Sub

    Private myWebResponse As Net.HttpWebResponse
    Private myStream As IO.Stream
    Private myReader As IO.StreamReader

    Private Sub getHTML(ByVal siteURL As String)
        Me.Cursor = Cursors.WaitCursor
        Try
            myWebResponse = CType(Net.HttpWebRequest.Create(siteURL).GetResponse, Net.HttpWebResponse)
            myStream = myWebResponse.GetResponseStream()
            myReader = New IO.StreamReader(myStream)
            extractHTML(myReader.ReadToEnd, ListBox1)
            myReader.Close()
            myStream.Close()
            myWebResponse.Close()
        Catch ex As Exception
            MsgBox("There was a connection problem.", MsgBoxStyle.Critical)
        End Try
        Me.Cursor = Cursors.Default
    End Sub

    Private iSi, iEi As Integer, arTemp(), sTemp, sItemToAddToListBox As String

    Private Sub extractHTML(ByVal htmlContent As String, ByVal selListbox As ListBox)
        selListbox.Items.Clear()
        With htmlContent
            iSi = .IndexOf("<td>IP address</td>")
            iEi = .IndexOf("</table>", iSi)
            arTemp = .Substring(iSi, iEi - iSi).Split("/"c)
        End With
        sTemp = "<td><span>"
        For i As Integer = 0 To arTemp.Length - 1
            With arTemp(i)
                If .ToLower.Contains(sTemp) Then
                    sItemToAddToListBox = .Substring(.IndexOf(sTemp) + sTemp.Length).Replace("<", "")
                    sItemToAddToListBox &= ":" & arTemp(i + 2).Substring(.IndexOf("<td>") + 5).Replace("<", "")
                    selListbox.Items.Add(sItemToAddToListBox)
                End If
            End With
        Next
        MsgBox("done")
    End Sub
End Class
Alleyn commented: Amazingly Helpful +0
codeorder 197 Nearly a Posting Virtuoso

"DUDE!!!", what's the hurry, we're not getting paid here. :D

See if this helps.

If Not CType(Me.Controls(TextBox1.Text), LinkLabel) Is Nothing Then
            With CType(Me.Controls(TextBox1.Text), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

Nice app. btw.:)

codeorder 197 Nearly a Posting Virtuoso

Option Strict On - msdn
Supposably, it makes you app. less prone to errors and/or crashing.

codeorder 197 Nearly a Posting Virtuoso

I made this for someone back in March and it works with 4 Columns in a ListView.
1 ListView needed for testing.

Option Strict On
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListView1
            .Columns.Add("FirstName", 100) : .Columns.Add("LastName", 100) : .Columns.Add("Age", 100) : .Columns.Add("In Class?", 100) : .View = View.Details : .CheckBoxes = True : .FullRowSelect = True
            With .Items
                Dim lvItm As New ListViewItem("xnew,subitem,23,Yes".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("a 1new,1subitem,23,No".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("b 2new,2subitem,23,Yes".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("c 2new,1subitem,43,No".Split(CChar(",")))
                .Add(lvItm)
                lvItm = New ListViewItem("a 2new,2subitem,43,Yes".Split(CChar(",")))
                .Add(lvItm)
            End With
        End With
    End Sub

    Private Sub ListView1_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView1.ColumnClick
        '// check if it contains items.
        If Not ListView1.Items.Count = 0 Then lvColumnSort(e.Column, ListView1) '// send Column Index and the ListView used.
    End Sub

#Region "================= SORT LISTVIEW COLUMNS BY SELECTED COLUMN ================="

    Private arlSortLvItems As New ArrayList '// adds ListView items to.
    Private bSortDescending As Boolean = True '// Toggles if .Ascending or Descending.

    Private Sub lvColumnSort(ByVal columnIndex As Integer, ByVal selectedListView As ListView)
        With selectedListView
            arlSortLvItems.Clear() '// clear ArrayList for new input.
            For Each itm As ListViewItem In .Items '// loop thru ListView.Items
                Select Case columnIndex '// check which column is clicked and add items to ArrayList as needed, first item will be the .Sorting item.
                    Case 0 '// FirstName, LastName, Age, InClass.
                        arlSortLvItems.Add(itm.Text & "~" & itm.SubItems(1).Text & "~" & itm.SubItems(2).Text & "~" & itm.SubItems(3).Text)
                    Case 1 '// LastName, …
codeorder 197 Nearly a Posting Virtuoso

Which line is giving you the error?

>>...the control rows after the removed row should be changed so it's still in sequential order.
Sequential order for the # at the end of each control's name or just moving the rows under the delete row up?

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
        '// when adding new row of controls, add a Handler for your PictureBoxRemove.
        AddHandler PictureBoxRemove1.Click, AddressOf PictureBoxRemove_Click
        'AddHandler PictureBoxRemove2.Click, AddressOf PictureBoxRemove_Click
        'AddHandler PictureBoxRemove3.Click, AddressOf PictureBoxRemove_Click
    End Sub

    Private Sub PictureBoxRemove_Click(sender As System.Object, e As System.EventArgs)
        '// get name of sender and remove the name except for the end #.
        Dim sNumber As String = CType(sender, PictureBox).Name.Replace("PictureBoxRemove", "")
        With Panel1 '// your Panel.
            '// since you now have the # for the row, delete all controls that end w/that #.
            .Controls.Remove(CType(.Controls("PictureBoxAdd" & sNumber), PictureBox))
            .Controls.Remove(CType(.Controls("PictureBoxRemove" & sNumber), PictureBox))
            .Controls.Remove(CType(.Controls("TextBox" & sNumber), TextBox))
            .Controls.Remove(CType(.Controls("Button" & sNumber), Button))
        End With
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

I must have read your original post wrong, my apologies.

Since you are using Me.Hide in Form2 and not Me.Close, the Form2_Load event will only fire off the first time it loads, after that it hides and shows, does not reload.
You could use Me.Close or just set the value the Form2.Label right before showing Form2 again.

user1 = TextBox1.Text
        With Form2
            .Label1.Text = user1
            .Show()
        End With
codeorder 197 Nearly a Posting Virtuoso

Also, see if this helps.

Dim sTemp As String = "a_b_c_d" '// your String.
        Dim arTemp() As String = sTemp.Split("_"c) '// .Split String into Arrays.
        For Each itm As String In arTemp '// loop thru Arrays.
            '// find your Array and get value.
            If itm.StartsWith("c") Then MsgBox(itm)
        Next
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If Not Module1.sUserKeptAsPermanent = Nothing Then
            Form2.Label1.Text = sUserKeptAsPermanent
        Else
            sUserKeptAsPermanent = TextBox1.Text
            Form2.Label1.Text = Module1.sUserKeptAsPermanent
        End If
        Form2.ShowDialog()
    End Sub
End Class
Module Module1
    Public sUserKeptAsPermanent As String = Nothing
    Public user1 As String = Nothing
End Module

Basically, you set the String in the Module once and always load same String.
As for user1 String, not sure what it is needed for.

codeorder 197 Nearly a Posting Virtuoso

Seems that line 13 is causing the error since it probably is an Array and you need to have an index for which Array to get the value from, not the entire Array.

Try this:

MsgBox(movieArray(a))
Jake.20 commented: Great help. +3
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private arLetterChars() As Char = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 "
    Private arEncryptedChars() As Char = "¿s¢çc‹i˜Ö´åÄÚKÍìæ¯~4Ûÿ5ÑûÏÉí³èô§ŠÀÙ9ÒÓ?þ.äƒ%*𾆱HI2@æŒ,"

    '// encrypt.
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With TextBox1
            For Each myTextBoxChar As Char In .Text '// loop thru TextBox, one char. at a time.
                For i As Integer = 0 To arLetterChars.Length - 1 '// loop thru all letters in the Array.
                    '// if TextBox char ='s the char in your Array, replace the TextBox char with the same #'ed Array char of the Encrypted letters.
                    If myTextBoxChar = arLetterChars(i) Then .Text = .Text.Replace(myTextBoxChar, arEncryptedChars(i))
                Next
            Next
        End With
    End Sub
    '// decrypt.
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        With TextBox1
            For Each myTextBoxChar As Char In .Text '// loop thru TextBox, one char. at a time.
                For i As Integer = 0 To arEncryptedChars.Length - 1 '// loop thru all Encrypted char.s in the Array.
                    '// if TextBox char ='s the char in your Array, replace the TextBox char with the same #'ed Array char of the Letters.
                    If myTextBoxChar = arEncryptedChars(i) Then .Text = .Text.Replace(myTextBoxChar, arLetterChars(i))
                Next
            Next
        End With
    End Sub
End Class

This uses 2 For/Next loops.
First loop, loops through each char. in the TextBox, one at a time. The loop inside the first loop, loops through the char.s in your Arrays, depending on which Array to use, if to encrypt or decrypt.
If a letter is the same letter as in …

debasisdas commented: agree +13
codeorder 197 Nearly a Posting Virtuoso

Make what work?

codeorder 197 Nearly a Posting Virtuoso

You said "easy", correct?:D

'// encrypt.
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        With TextBox1
            .Text = .Text.Replace("a", "z").Replace("b", "y").Replace("c", "x")
        End With
    End Sub
    '// decrypt.
    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        With TextBox1
            .Text = .Text.Replace("z", "a").Replace("y", "b").Replace("x", "c")
        End With
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Use a BackgroundWorker. Here's a start.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        '// CInt="Convert To Integer".
        If CInt(txtInput.Text) >= 0 AndAlso CInt(txtInput.Text) <= 9 Then '// if correct # entered, proceed.
            Dim rnd As New Random '// declare new random.
            lblRandom.Text = rnd.Next(0, 10).ToString '// Randomize (0 is minimum #, 10 is max and will only randomize to 9)
            If CInt(txtInput.Text) > CInt(lblRandom.Text) Then lblOutput.Text = "You Win!"
            If CInt(txtInput.Text) < CInt(lblRandom.Text) Then lblOutput.Text = "You Lose!"
            If CInt(txtInput.Text) = CInt(lblRandom.Text) Then lblOutput.Text = "Draw!"
        Else
            MsgBox("Number entered can only be between 0 and 9.", MsgBoxStyle.Critical)
            txtInput.Select()
            txtInput.SelectAll()
        End If
    End Sub

    '// Numeric TextBox.
    Private Sub txtInput_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtInput.KeyPress
        Select Case e.KeyChar
            Case "1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c, "0"c, CChar(vbBack) '// allow numeric and backspace.
                Exit Sub
            Case Else
                e.Handled = True '// block.
        End Select
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Use the If statements inside one another.

If 1 > 0 Then
            If 2 < 3 Then
                If 4 = 4 Then
                    MsgBox("You Win! :)", MsgBoxStyle.Information)
                Else
                    MsgBox("error", MsgBoxStyle.Critical)
                End If
            Else
                MsgBox("You Tie! :/", MsgBoxStyle.Information)
            End If
        Else
            MsgBox("You Loose! :(", MsgBoxStyle.Information)
        End If
codeorder 197 Nearly a Posting Virtuoso

Hey, Nice job down voting this for someone who was just trying to get some other ideas and perspective.

How about next time you leave your name instead of dancing around like a twinkled toed douche bag.

Unhnd

Took care of it and gave you another fresh start as you did for yourself.

Company name from an IT forum member, here we go:

Evolved Construction

With a software developer's mind, Evolved should not be a difficult task.

Unhnd_Exception commented: :) +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim arTemp() As String = Nothing '// Array to .Split each TextBox line.
        For Each txtLine As String In TextBox1.Lines '// loop thru all lines.
            arTemp = txtLine.Split("|"c) '// .Split line.
            For Each itm As String In arTemp '// loop thru arrays of current line.
                MsgBox(itm) '// display results.
            Next
        Next

>>(trying to make an For Next function)
A For/Next is just a "loop", unless you meant to have a Function w/a For/Next loop in it.

codeorder 197 Nearly a Posting Virtuoso

LOL. The mysterious Form1. :D

Your project might have gotten bugged somehow since vb.net does tend to come up with a few bugs here and there.

Suggestion: Try to create a new project.

codeorder 197 Nearly a Posting Virtuoso

Thanks for the info. :)

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

File Menu/Project/"your app's name" Properties.../Application tab.
.Set "Startup form:" to your Form, not Form1.

codeorder 197 Nearly a Posting Virtuoso

Line 23, change For i = 0 To ListView2.Items.Count.ToString - 1 to For i = 0 To ListView2.Items.Count.ToString [B]- 2[/B]

codeorder 197 Nearly a Posting Virtuoso

Do let us know if you still have this issue after reinstalling. Good for references. :)

codeorder 197 Nearly a Posting Virtuoso

I agree with sandeepparekh9 . Try reinstalling your operating system.
This should not be an issue, especially since you have 3 different browsers installed.

codeorder 197 Nearly a Posting Virtuoso

Check out this thread.

jingda commented: ;) +9
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Process.Start("http://www.google.com")
codeorder 197 Nearly a Posting Virtuoso

Wish I could be of further help, but I am completely confused on your issue.
.Good luck.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'// Clear all SelectedCells.
        For Each cell As DataGridViewCell In DataGridView1.SelectedCells : cell.Value = Nothing : Next
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim dt As New DataTable
        With dt '// FOR TESTING. 2 Columns with 2 Rows.
            With .Columns : .Add("1") : .Add("2") : End With
            With .Rows : .Add("a" & vbCrLf & "1", "b" & vbCrLf & "1") : .Add("a2" & vbCrLf & "1", "b2" & vbCrLf & "1") : End With
        End With
        '// loop thru DataTable.
        For Each row As DataRow In dt.Rows '// loop thru Rows.
            For Each column As DataColumn In dt.Columns '// loop thru each Column in Row.
                MsgBox("Before .Replace:" & vbNewLine & row(column).ToString) '// FOR TESTING.
                row(column) = row(column).ToString.Replace(vbCrLf, " ") '// replace vbCrLf with " " in each column, for each row.
                MsgBox("After .Replace:" & vbNewLine & row(column).ToString) '// FOR TESTING.
            Next
        Next
codeorder 197 Nearly a Posting Virtuoso

Cannot state what is unknown.
If possible, post your collections code and how you get a certain object/value from it.
Also, if the collection loads from a file, post some of the file content as well.
.Should be easy to try and provide a solution then, hopefully.

codeorder 197 Nearly a Posting Virtuoso

Have you tried a For/Next loop, to loop through all fields in the collection and replace data in each field if needed?

codeorder 197 Nearly a Posting Virtuoso

Have you tried TransactionFile.ToString ?
This might also be of some help.

codeorder 197 Nearly a Posting Virtuoso

You could also use a ArrayList to store the FullPath of a file.
.Check out this thread for some basic info on using a ArrayList.

codeorder 197 Nearly a Posting Virtuoso

Change MsgBox(ex.Message) to TextBox1.Clear in the Try/Catch of my previously posted code.

Try
            '// run all code here that can/might cause an error.
        Catch ex As Exception
            '// add code here to correct the error if it does occur.
        End Try
codeorder 197 Nearly a Posting Virtuoso

Ok. With the above posted code, using MsgBox(arTemp(0)) , you will get "one", MsgBox(arTemp(1)) will get you "two", and MsgBox(arTemp(2)) will get you "three" from the arTemp String Array.
.Since in my code I had MsgBox(arTemp(3)) , that Array does not exist in arTemp, which should return a "four", therefore you get the error of "Index was outside the bounds of the Array".

Basically saying, that error will let you know when you are trying to locate something that is not there, it is "outside the bounds", bounds meaning Array length/count.

codeorder 197 Nearly a Posting Virtuoso

>>it says "Index was outside the bounds of the arrays"

This usually occurs when your (i) goes over the Array length/count.
.Here's an example.

Try
            Dim arTemp() As String = {"one", "two", "three"}
            MsgBox(arTemp(3))
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Since Arrays start at 0 not 1, the arTemp(3) is actually Array 4, which is not included in my declared Array. Therefore you will get the error message.