|
-
Sep 19th, 2007, 09:24 PM
#1
Thread Starter
Hyperactive Member
How to access the event in simplest way
Normally, if I want to make my textbox or combobox change the backcolor when the user gotfocus on the controls i will using the code like this.
VB Code:
Private Sub Text1_GotFocus()
Text1.BackColor = vbYellow
End Sub
Private Sub Text1_LostFocus()
Text1.BackColor = vbWhite
End Sub
But I need to create the code for every control
Got any method allowed me to do only one time for every control ?
Thanks
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
-
Sep 19th, 2007, 09:53 PM
#2
Re: How to access the event in simplest way
Every control? Or every Textbox? If its every textbox.. then just use a control array (search the forums for that).
If its for every control.. then you'll have to subclass the form and change the backcolor of the control through APIs (because theres no way to do something like, wParam.BackColor..).
chem
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Sep 19th, 2007, 10:30 PM
#3
Thread Starter
Hyperactive Member
Re: How to access the event in simplest way
Yes, The only way is array ..
I had changed it ...
Thanks sir..
I'm Not similar to APIs ...
Where there is no hope, there can be no endeavor.
There are two ways of rising in the world, either by your own industry or by the folly of others.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|