|
-
Nov 21st, 2000, 04:53 PM
#1
Thread Starter
Frenzied Member
How can i use the createobject() function to create objects like buttons, textboxes etc ? and then to know when an event like text change has occured on the new textbox ?
-
Nov 21st, 2000, 05:30 PM
#2
_______
<?>
Code:
Option Explicit
' Remarks:
' Dynamically add a new button to the form. The
' item to add, a button in this case, must be a
' member of the VB object as displayed in the
' Object Browser. The second parameter is the
' the new control's name.
'
Private WithEvents btnObj As CommandButton
Private Sub btnObj_Click()
'
' Respond to the new button's Click event.
'
MsgBox "This button was added at run time!"
End Sub
Private Sub cmdAdd_Click()
Set btnObj = Controls.Add("VB.CommandButton", "btnObj")
'
With btnObj
.Visible = True
.Caption = "&Dynamically Added Button"
.Top = 0
.Left = 0
.Width = 2400
.Height = 500
End With
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 21st, 2000, 05:52 PM
#3
Addicted Member
Re: <?>
Hi,
While you are at it could you please tell me hoe to create a Msword object?
when I use CreateObject("Word.Application") I get runtime error 429
Thanks
-
Nov 21st, 2000, 06:55 PM
#4
Addicted Member
umm when i add that to a class like to make the object it dont work it saud the controls.add thing is not a vrable , but when i tested it on a button or somthing it worked , can you help me
WHat would we do with out Microsoft.
A lot more.
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
|