Closed Thread
Results 1 to 4 of 4

Thread: If Statement Problem

  1. #1
    .Sin is offline Newbie
    Join Date
    Jan 2008
    Posts
    4
    Rep Power
    0

    If Statement Problem

    Hey, I have another quick question.

    I have an if statement
    that says
    Code:
    if cmdOK.Visible = false then GoTo form2
    and when i click the button it says label not defined
    Last edited by TcM; 01-17-2008 at 07:03 AM. Reason: Add Code Tags

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Please Use Code Tags in your posts, takes only a sec
    Please Make a New Thread For Every Separate Question You Have


    Now to your Question:

    Your code is wrong it should be something like

    Code:
    If cmdOk.Visible = False Then Form2.Show
    Hope it helped. If It did help please don't forget to add +rep to my post, Thanks

  4. #3
    HiGuys is offline Newbie
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Re: If Statement Problem

    Code:
    If(cmdOk.Visible = False) Then {
    Form2.Show
    }

  5. #4
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: If Statement Problem

    Sorry HiGuys, your code won't work.

    You are mixing two different languages. The curly braces {} are a C# syntax, while the single comparison operator = instead of == is a VB.NET syntax.

    VB.NET:
    Code:
    If Not (cmdOk.Visible) Then Form2.Show
    C#:
    Code:
    if (!cmdOk.Visible) Form2.Show();

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. If statement problem
    By robbiewoods05 in forum C and C++
    Replies: 9
    Last Post: 06-13-2011, 04:04 AM
  2. Problem in SQL Statement
    By newphpcoder in forum PHP Development
    Replies: 24
    Last Post: 05-11-2011, 05:23 AM
  3. Problem preparing statement
    By elgranjeff in forum PHP Development
    Replies: 0
    Last Post: 06-29-2010, 12:19 AM
  4. Java- Not a statement problem
    By gandudu in forum Java Help
    Replies: 1
    Last Post: 06-22-2010, 01:38 PM
  5. Looping statement problem : TOTAL Course fee
    By syarif20 in forum C and C++
    Replies: 8
    Last Post: 09-12-2009, 02:15 AM

Tags for this Thread

Bookmarks

Posting Permissions

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