Newbie: want to create instance of line control at run time through code
-
HI guys its me again I'm really stuck and I need the help. I want to create an instance of the line control on my form at run time. But some how the following code doesn't work DIm line1 as Line Set line1 = New Line 'setting line properties line1.visible = true I really need to knwo how to do this and I don't want to use any drawline functions as I don't want to draw a bitmap just want to be able to create an instance of the line control. I really need the help I'm using vb6
-
HI guys its me again I'm really stuck and I need the help. I want to create an instance of the line control on my form at run time. But some how the following code doesn't work DIm line1 as Line Set line1 = New Line 'setting line properties line1.visible = true I really need to knwo how to do this and I don't want to use any drawline functions as I don't want to draw a bitmap just want to be able to create an instance of the line control. I really need the help I'm using vb6
You probably didn't add the new Line control to the Controls collection of the object onto which your drawing. For instance, if your drawing on the surface of a Form (not a picture box!), you would have to add the control to the Controls collection of the Form:
Dim WithEvents myLine As Line
Set myLine = Form1.Controls.Add("VB.Line", "myLineControl")
myLine.Visible = TrueThe
VB.Line
might be a bit different. Check in the Object Browser (F2) to see what the exact name of the control is if notVB.Line
. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome