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
Printable View
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
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°°»
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".