2 Replies - 799 Views - Last Post: 14 May 2010 - 04:26 AM Rate Topic: -----

#1 EndLessMind  Icon User is offline

  • These are the droids you're looking for
  • member icon

Reputation: 194
  • View blog
  • Posts: 1,099
  • Joined: 13-March 09

Using case statement

Posted 14 May 2010 - 03:53 AM

Hi.
This i probably a dumb question.

But how do i use "Case" statement?
I have a button that i need to do 2 things.
When i click on it the first time, a textbox should appear. When i click on it again, it should disappear.
So i thing the best way is to use "case" statement. But i've never used it so i don't know how to, and i couldn't find any good explanation on google.

Anyone that can help me understand this? :)

Thanks in advance :)

Is This A Good Question/Topic? 0
  • +

Replies To: Using case statement

#2 danny_kay1710  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 28
  • View blog
  • Posts: 358
  • Joined: 27-April 08

Re: Using case statement

Posted 14 May 2010 - 03:58 AM

Although you can use a case statement in that case to check whether the TextBox is visible or not there is an easier solution which is just one line of code.

However for the purpose of helping you with a case statement:

http://www.google.co...+case+statement

A quick google search shows some promising results.

This post has been edited by danny_kay1710: 14 May 2010 - 03:59 AM

Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Using case statement

Posted 14 May 2010 - 04:26 AM

Just set the visible property to its opposite value

All you need in the button code is
Textbox1.Visible = NOT Textbox1.Visible

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1