 |
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: very very urgent! help!
There was a similar topic at:
http://www.andreavb.com/forum/viewtopic.php?TopicID=40#129
it may provide the info you need (especially the Microsoft link in it).
Your request for free graphical buttons... Not sure what you mean really, a graphical command button is just a normal command button with the type (or is it style?) property changed to graphical, then you put a picture on it.
[Edited by JLRodgers on 10-01-2003 at 02:23 PM GMT]
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
10-01-2003 at 08:21 PM |
|
|
vbgen Level: Moderator
 Registered: 10-10-2002 Posts: 876
|
Change Your Subject Title...
hello! welcome to the forum!
kindly change your subject's title next time, so that this post can be easily searched for by others who use the search option before posting at the board, okay? thank you.
as for the code, try this snippet i found a while back...
it includes a built-in control, and activex control, and a lib type
' If you are adding an ActiveX control at run-time that is
' not referenced in your project, you need to declare it
' as VBControlExtender.
Dim WithEvents ctlDynamic As VBControlExtender
Dim WithEvents ctlText As VB.TextBox
Dim WithEvents ctlCommand As VB.CommandButton
Private Sub ctlCommand_Click()
ctlText.Text = "You Clicked the Command button"
End Sub
Private Sub ctlDynamic_ObjectEvent(Info As EventInfo)
' test for the click event of the TreeView
If Info.Name = "Click" Then
ctlText.Text = "You clicked " _
& ctlDynamic.object.selecteditem.Text
End If
End Sub
Private Sub Form_Load()
Dim i As Integer
' Add the license for the treeview to the license collection.
' If the license is already in the collection you will get
' the run-time error number 732.
Licenses.Add "MSComctlLib.TreeCtrl"
' Dynamically add a TreeView control to the form.
' If you want the control to be added to a different
' container such as a Frame or PictureBox, you use the third
' parameter of the Controls.Add to specify the container.
Set ctlDynamic = Controls.Add("MSComctlLib.TreeCtrl", _
"myctl", Form1)
' set the location and size of the control.
ctlDynamic.Move 1, 1, 2500, 3500
' Add some nodes to the control.
For i = 1 To 10
ctlDynamic.object.Nodes.Add Key:="Test" & Str(i), Text:="Test" _
& Str(i)
ctlDynamic.object.Nodes.Add Relative:="Test" & Str(i), _
Relationship:=4, Text:="TestChild" & Str(i)
Next i
' Make the control visible.
ctlDynamic.Visible = True
' add a textbox
Set ctlText = Controls.Add("VB.TextBox", "ctlText1", Form1)
' Set the location and size of the textbox
ctlText.Move (ctlDynamic.Left + ctlDynamic.Width + 50), _
1, 2500, 100
' Change the backcolor.
ctlText.BackColor = vbYellow
' Make it visible
ctlText.Visible = True
' Add a CommandButton.
Set ctlCommand = Controls.Add("VB.CommandButton", _
"ctlCommand1", Form1)
' Set the location and size of the CommandButton.
ctlCommand.Move (ctlDynamic.Left + ctlDynamic.Width + 50), _
ctlText.Height + 50, 1500, 500
' Set the caption
ctlCommand.Caption = "Click Me"
' Make it visible
ctlCommand.Visible = True
End Sub |
____________________________
Been busy trying to take a second degree <--it's not working out...
|
|
11-01-2003 at 06:47 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: very very urgent! help!
Ah, the code from the Microsoft page.
It took me a half hour of searching the board to find the thread and the link that was originally posted.
Oh, and if/when you do change the subject, I'd suggest "Dynamic controls" or "Add controls at Run Time".
____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)
|
|
11-01-2003 at 07:27 PM |
|
|
|
|
 |
 |