Click here to Skip to main content
15,888,065 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
If form2.button1.clicked then
me.hide()
else
form3.showdialog()
end if

What I have tried:

I do not know any code for this. Please help me!
Posted
Updated 20-Mar-16 13:05pm
v2

1 solution

It doesn't work like that: What you denote as a hypothetical boolean property "clicked" of the class Button (I assume you mean System.Windows.Forms.Button) exists in form of an event named Click. Events aren't being read like a field or a property like in your theoretical code sample. They're being subscribed to and when they "fire" the method(s) that are subscribed to them ("event-handlers") are being called.

Try this:
- Open or create a project with a form.
- Open the form in the designer and place a button onto it.
- Double-click the button. Visual Studio automatically creates a method-stub (named "Button1_Click" if you didn't rename the button) and adds it to the subscriber-list of the Click-event of that button. Whenever the button is clicked that method will be called.
- Write the code that should be executed when the button is clicked into that method.

I strongly recommend you to find some books and/or good online tutorials. You're obviously a beginner and at that point you will learn faster and more thoroughly from a book or similar than asking in forums.
 
Share this answer
 
Comments
ionMEMBER 21-Mar-16 12:01pm    
Thank you very much for solution !!!
Sascha Lefèvre 21-Mar-16 12:21pm    
You're welcome! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900