|
-
Dec 16th, 1999, 02:52 AM
#1
Thread Starter
Addicted Member
I put this code in a program for having a bigger cursor for EVERY textbox:
Private Sub txtOrdArtikelnr_GotFocus()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Private Sub txtOrdArtikelOms_GotFocus()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Private Sub txtOrdaantal_GotFocus()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Private Sub txtOrdEenheid_GotFocus()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Private Sub txtOrdPrijs_GotFocus()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
And several more of these sub's. I think this can be done better and easy'er. Any one have suggestions ?
------------------
-
Dec 16th, 1999, 02:56 AM
#2
Create a Textbox Control Array, then you can use the Same piece of code for all the Textboxes.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Dec 16th, 1999, 03:06 AM
#3
Member
It would much easier if u created those textboxes as control array in first place.
Just place the code in one sub
Private Sub txtOrder_GotFocus(Index as Integer)
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Make it sub and call it, not much but u can reduce some code their 
Delcare as public in module if diffrent forms call it
private sub BigCursor()
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
end sub
Joon
[This message has been edited by jpark (edited 12-16-1999).]
-
Dec 16th, 1999, 03:34 AM
#4
Thread Starter
Addicted Member
Thanks Aaron and Joon for the fast reply. This will work but I still have to make a sub for every textbox in the program for calling the BIGCURSOR. What I was thinking was: When in the whole program a textbox got the focus (GotFocus) the cursor become's big.
(maybe you can give me an example off a textbox control array ?, I am not quit understanding what this means)
------------------
-
Dec 16th, 1999, 05:01 AM
#5
Member
Why do u have to make the sub for every textbox? Make one and call it for each textbox's GotFocus event.
Textbox control array example
On the Form, draw a TextBox, and name it.
(In this example, I called it "txtOrder")
Copy the textbox and paste it as many as u need.
(When first one is pasted, the massagebox will ask u to create control array.)
Put the code to change a big picture in the GotFous events of txtOrder textbox control array.
Private Sub txtOrder_GotFocus(Index as Integer)
h& = GetFocus&(): sb& = Picture1.Picture: Call CreateCaret(h&, sb&, 1, 5): sx& = ShowCaret&(h&)
End Sub
Joon
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
|