hi
I have picture box .inside the picturebox i have so many controls is there.
I want to store the all properties values in to structure at runtime.
because i am using structure for undo redo opertion.
Printable View
hi
I have picture box .inside the picturebox i have so many controls is there.
I want to store the all properties values in to structure at runtime.
because i am using structure for undo redo opertion.
You mean something like:? You could declare a new type as an array and store each control's properties with a loop through controls.VB Code:
Option Explicit Private Type properties left As Single top As Single width As Single height As Single '... End Type Dim Label1_properties As properties Private Sub Form_Load() With Label1_properties .left = Label1.left .top = Label1.top .width = Label1.width .height = Label1.height '... End With End Sub
iterate through Form.Controls... check that .Container.Name for each control in form.controls is picturebox name... you can then create code to retreive relevant properties/values for each control type.
gavio, agpasam and leinad31 - you are all very kind!
Thankyou for your replies. This method of saving control positions has helped me:
i) Drag controls at runtime, on a picture box.
ii) Save the control positions to a database.
iii) Re-call the positions from the database, to show the controls again on the screen.
Thanks again - and i hope to make a mini tutorial on this, to share with the world.
you might also want to look at this thread: http://www.vbforums.com/showthread.php?t=419673