|
-
Jun 20th, 2002, 04:59 PM
#1
Thread Starter
New Member
create control derived of another control
Hello, bear with me I am new in this, I want to build a control derived of the textbox control with its properties and events, How can I create it?
Thank
-
Jun 21st, 2002, 06:12 AM
#2
Ok, ive posted this before, but its pretty simple to get used to. Im guessing you want to make an Object from scratch. You want that object to be a textbox. Ok, first off, u need to Dimension an Object. So;
Dim newcmdbutton As Object
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Text1.Text = "CommandButton" Then
Set newcmdbutton = Form1.Controls.Add("VB.COMMANDBUTTON", "Command1")
newcmdbutton.Height = 495
newcmdbutton.Width = 1215
newcmdbutton.Left = 30
newcmdbutton.Top = 30
newcmdbutton.Caption = "Command1"
newcmdbutton.Visible = True
End If
End If
End Sub
Basically, what that does is, If you type CommandButton into a TextBox called Text1, and press Enter(KeyCode 13) it creates a new CommandButton called Command1. Hope this gives you hope.
«°°phReAk°°»
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Jun 21st, 2002, 11:31 PM
#3
PowerPoster
The easiest way is to use the ActiveX control Interface wizard in your Add ins menu.
Put a textbox on your Control then run the wizard.. when it gets to the "maps to" part select the property you want to use and select the textbox in the drop down comobo box under "maps to".
-We have enough youth. How about a fountain of "Smart"?
-If you can read this, thank a teacher....and since it's in English, thank a soldier.

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
|