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

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




Creating controls in application

 
Reply to this topicStart new topic

Creating controls in application, adding control buttons and text field

r10lover10
27 Jan, 2008 - 06:25 PM
Post #1

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
My current assignment is adding 2 same size control buttons that are in red and green color. Add another textfield and when the particular button was clicked, it changes the text field to the color of the button.

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

Jayman
RE: Creating Controls In Application
27 Jan, 2008 - 07:09 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,297



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
The great thing about Visual Studio (VS) is that it is a WYSIWYG (What You See Is What You Get) editor. So putting controls on your form is as simple as dragging the control from the ToolBox and dropping it on your form.

What have you tried so far? Have you opened VS and created a project, yet?
User is offlineProfile CardPM
+Quote Post

r10lover10
RE: Creating Controls In Application
28 Jan, 2008 - 08:08 AM
Post #3

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
I am able to add control buttons, but the part i didn't get is to change the textfield color when the button is clicked.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Creating Controls In Application
28 Jan, 2008 - 10:55 AM
Post #4

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,297



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
You can use the BackColor property of the textbox to change its color. Just put it inside the buttons Click event.
User is offlineProfile CardPM
+Quote Post

souptoy
RE: Creating Controls In Application
28 Jan, 2008 - 11:39 AM
Post #5

New D.I.C Head
*

Joined: 17 Jan, 2008
Posts: 23



Thanked: 1 times
My Contributions
QUOTE(r10lover10 @ 28 Jan, 2008 - 09:08 AM) *

I am able to add control buttons, but the part i didn't get is to change the textfield color when the button is clicked.



If you're trying to change the color of the text then you want to use the ForeColor property and if it's just the background color of the text box then use the BackColor property. And as stated above, place the code you write in the OnClick events.
User is offlineProfile CardPM
+Quote Post

r10lover10
RE: Creating Controls In Application
28 Jan, 2008 - 03:12 PM
Post #6

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
thanks guy, i am glad it wasn't that difficult to mess with VB.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 10:35AM

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