Results 1 to 4 of 4

Thread: VB.NET If Statement

  1. #1
    Senior Members' Member Matt1eD's Avatar
    Join Date
    Feb 2005
    Location
    London
    Posts
    2,462
    Thanks
    0
    Thanked
    0 times in 0 posts
    • Matt1eD's system
      • Motherboard:
      • MSI K9N6SGM-V GeForce 6100
      • CPU:
      • Athlon 64 LE-1620 2.41GHz
      • Memory:
      • 2 GB DDR2
      • Storage:
      • 1.25 TB
      • Graphics card(s):
      • Onboard
      • PSU:
      • eBuyer Extra Value 500W!
      • Operating System:
      • XP Pro

    VB.NET If Statement

    It's been about a year and a half since I did some VB, and that was in 6. Now I decided to do a very small little proggy. I love the My and Me commands in .NET 2005.....

    iirc in VB6 writing for a button If.ListBox1.Text = "Pen" Then Formxyz.Show End If

    I've played around with that, then with the My and My commands for it, and got nowhere.

    Any ideas?

    Thanks

  2. #2
    HEXUS webmaster Steve's Avatar
    Join Date
    Nov 2003
    Posts
    14,283
    Thanks
    293
    Thanked
    841 times in 476 posts
    In VB6 which I haven't used for a few months now (ah, college uses such up to date software) my code would have looked like this:
    Code:
    If (ListBox1.Text = "Pen") Then
        Formxyz.Show
    End If
    PHP Code:
    $s = new signature();
    $s->sarcasm()->intellect()->font('Courier New')->display(); 

  3. #3
    Registered+
    Join Date
    Mar 2005
    Posts
    33
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by Matt1eD
    It's been about a year and a half since I did some VB, and that was in 6. Now I decided to do a very small little proggy. I love the My and Me commands in .NET 2005.....

    iirc in VB6 writing for a button If.ListBox1.Text = "Pen" Then Formxyz.Show End If

    I've played around with that, then with the My and My commands for it, and got nowhere.

    Any ideas?

    Thanks
    What exactly is your question/problem? Your "IF" statement looks fine to me as does Steve's code below.

    Are you simply wanting an example of how to use Me and My?

  4. #4
    Senior Members' Member Matt1eD's Avatar
    Join Date
    Feb 2005
    Location
    London
    Posts
    2,462
    Thanks
    0
    Thanked
    0 times in 0 posts
    • Matt1eD's system
      • Motherboard:
      • MSI K9N6SGM-V GeForce 6100
      • CPU:
      • Athlon 64 LE-1620 2.41GHz
      • Memory:
      • 2 GB DDR2
      • Storage:
      • 1.25 TB
      • Graphics card(s):
      • Onboard
      • PSU:
      • eBuyer Extra Value 500W!
      • Operating System:
      • XP Pro
    Sorry, Steve's worked.

    Was certain I'd tried that, oh well.

    This is put into me and my commands:

    Code:
    If Me.ListBox1.Text = "Hertfordshire" Then
                My.Forms.hertfordshire.Show()
            End If
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VB.NET Compact Framework List View Problem
    By Spud1 in forum Software
    Replies: 1
    Last Post: 08-04-2005, 11:54 PM
  2. Using a switch statement and MySQL database
    By Kezzer in forum Software
    Replies: 2
    Last Post: 15-10-2004, 01:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •