|
-
Nov 23rd, 2006, 09:27 PM
#1
Thread Starter
Junior Member
How to Save the control position in to structure at runtime
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.
-
Nov 23rd, 2006, 09:50 PM
#2
Re: How to Save the control position in to structure at runtime
You mean something like:
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
? You could declare a new type as an array and store each control's properties with a loop through controls.
-
Nov 23rd, 2006, 11:24 PM
#3
Re: How to Save the control position in to structure at runtime
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.
-
Nov 25th, 2006, 11:41 AM
#4
New Member
Re: How to Save the control position in to structure at runtime
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.
-
Nov 25th, 2006, 12:03 PM
#5
Re: How to Save the control position in to structure at runtime
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
|