Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


can anyone help me to create a usercontrol


can anyone help me to create a usercontrol

Author
Message
pras
pras
Forum God
Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)Forum God (395 reputation)

Group: Forum Members
Posts: 1, Visits: 1

hi guys

  i want to know how to create a user control , i want a textbox to except only numeric characters  , how can i create this control , is this a user control or ocx control , pls let me know

thanks

pras



prasath


<
major
major
Forum God
Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)Forum God (37K reputation)

Group: Forum Members
Posts: 367, Visits: 100
Hi pras, there are 2 tutorials on user controls at www.codeyourself.com, click visual basic 6 , activex you will come across 2 tutorials, I think you want the second one titled, Spinner control.



Zooker
Zooker
Forum God
Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)Forum God (2.9K reputation)

Group: Forum Members
Posts: 85, Visits: 7

I don't know anything about user controls but, u can use a standart text box and in the Key Press sub use the following code:

Select Case KeyAscii

          Case 48 to 57

                 KeyAscii=Keyascii

          Case 46

                KeyAscii=Keyascii

          Case Else

                KeyAscii =0

End Select


Eddie74
Eddie74
Forum God
Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)Forum God (5.6K reputation)

Group: Forum Members
Posts: 36, Visits: 165
The above code is good, but you still need to know how to create a user control.  First, i will assume you are useing vb6.  Click new project > user control.

second - place a textbox on the top left hand corner. set the top and left properties to 0.

Third set the UserControl width and height to match the text box's width and height.

Run the Active X control interface  wizard and assign all the usual properties to the textbox control.  Add the code provided above. Compile the project into an OCX. Voila. Finished.

If it ain't busted...DON'T FIX IT!

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search