Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,470 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,991 people online right now. Registration is fast and FREE... Join Now!




changing color with clicking dialogue box

 
Reply to this topicStart new topic

changing color with clicking dialogue box, 1st assignment and it's due this evening

r10lover10
21 Jan, 2008 - 08:53 AM
Post #1

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
My 1st assignment of VB.net is to change color to red when clicking the dialogue box once, and change color to green when clicking the dialogue box twice.

I am new to VB.net, any help would be greatly appreciated.
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Changing Color With Clicking Dialogue Box
21 Jan, 2008 - 09:26 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
There are two events of the form that will help you with this. Click and Doubleclick.

Start a new project and once your form is up select it and hit the little lightning bolt icon on your properties window. This will show you the events that the form can handle. There you will see the click and doubleclick events.

Select the click event from the list and double click it to create an event. In the event you will want to simply change the background color like so...

CODE

me.backColor = Color.Red


Write similar code for the doubleclick event (select it from the list and doubleclick it so that it will create the event for you).

Once you run it you will see that a simple click will turn the background red and doubleclicking it will turn it green.

I hope that is what you were looking to do. Enjoy!

"At DIC we be backColor masters of the universe... that and code ninjas!" decap.gif
User is offlineProfile CardPM
+Quote Post

r10lover10
RE: Changing Color With Clicking Dialogue Box
21 Jan, 2008 - 03:27 PM
Post #3

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
Thanks Martyr2, I can turn in my assignment on time. biggrin.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 02:24PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month