How to Make a Function which can set the GotFoucs bgcolor
Hello Every One !
i was using my code
textbox1.bgcolor = ___colorname___
on the gotfoucs event of my textbox , but if i have 34 textboxes then i have to write this line 34 times , which cost lots of time , can any one help me to make any function or sub , so that it can automatically change the bgcolor when textbox gotfoucs ,
thanks in advance,
Assuming you want to do this to all text controls on the form, add the following to subs
Private Sub Text_Enter(sender As System.Object, e As System.EventArgs)
DirectCast(sender, TextBox).BackColor = Color.Yellow
Private Sub Text_Leave(sender As System.Object, e As System.EventArgs)
DirectCast(sender, TextBox).BackColor = Color.White
Then add the following for the form load event handler
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
For Each ctrl As Control In Me.Controls
If TypeOf (ctrl) Is TextBox Then
AddHandler ctrl.Enter, AddressOf Text_Enter
AddHandler ctrl.Leave, AddressOf Text_Leave
The first two subs will supply the handler code for the enter and leave events. The form load code will add those handlers to all textboxes.
I have a new kitten (as of 4 days ago) who is making these postings somewhat difficult, although on the bright side, she is creating some very cryptic passwords as she chases the cursor while dancing on my keyboard.
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others
I made a prime number finder, it finds the nearest prime that is above and below any integer (Does not work that well with giant numbers.)
Made this in cpp.sh
Why would I need the x=y+1-1;?
x=y; just doesnt seem to work
Why is this?
And I know my coding ...
there are five tables (personTb, addressTb,churchTb) each holds data pertinent to an individual; (personAddress,personChurch) each hold the primary key for the person table and corresponding table IE personAddress holds primary key for addressTb.
both snippets work, my question is; Is my join correctly formatted?