|
-
Nov 20th, 2000, 11:16 PM
#1
Thread Starter
Junior Member
I have a program that I would like to be able to create a bunch of boxes from a set of coordinates from an outside file. Is there any way to have the program create a new box on its own, or do they have to all be made before the program starts?
-
Nov 20th, 2000, 11:30 PM
#2
look here, just replace "VB.CommandButton" with "VB.Shape"
http://forums.vb-world.net/showthrea...threadid=40271
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 20th, 2000, 11:34 PM
#3
Thread Starter
Junior Member
-
Nov 20th, 2000, 11:42 PM
#4
transcendental analytic
I haven't tested this at all, just wrote it and there still to write if you want to write the file, the data is stored binary...
Code:
'this dynamic array will contain the shapes created in runtime
'no need to mess with withevents since shapes don't have events.
Private shapes() As shape
'this is for the the stored properties of the shapes
Private Type tshape
top As Integer
left As Integer
width As Integer
height As Integer
End Type
'this will open a file, read the amount of shapes, and then read the array of tshapes
Dim count&, tshape() As tshape, x&
Open file For Binary As #1
Get #1, , count
ReDim tshape(count - 1)
Get #1, , tshape
Close
For x = 0 To count - 1
'this will create the shape and put it in shapes array
Set shapes(x) = Controls.Add("VB.Shape", "Shape" & x)
With tshape(x)'then just set the properties up...
shapes(x).left = .left
shapes(x).top = .top
shapes(x).width = .width
shapes(x).height = .height
shapes(x).shape = 0
shapes(x).Visible = True
End With
Next x
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|