|
-
Jul 28th, 2003, 08:27 PM
#1
Thread Starter
Lively Member
Loading option buttons at runtime
Hi everyone,
I am using this code to load 5 frames at form load. I need to load 2 option buttons into each frame. I can get an option button to load on the form, but not be contained in the frame(s). Is it possible?
On the form, I have a frame with Index set to 0 and 2 option buttons, each named Option1 with indexes of of 0 and 1.
Code:
Dim i As Integer
For i = 1 To 5
Load Frame1(i)
With Frame1(i)
.Top = Frame1(i - 1).Top + _
Frame1(i - 1).Height + 10
.Visible = True
.Caption = "Frame" & (i + 1)
End With
Next i
Thanks,
Michael
-
Jul 28th, 2003, 08:29 PM
#2
So Unbanned
Use the SetParent API to make the frame the owner. It'll then be in it, and there's no chance of escape!
Public Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
There's the declare.
-
Jul 29th, 2003, 12:36 PM
#3
Thread Starter
Lively Member
Darn ...
Now I am forced to learn programming to the API! I knew it was going to happen soon, but did not want that time to be today.
Thanks
Digital
-
Jul 29th, 2003, 01:18 PM
#4
So Unbanned
Originally posted by IGBP
Darn ...
Now I am forced to learn programming to the API! I knew it was going to happen soon, but did not want that time to be today.
Thanks
Digital
SetParent Option1.hwnd, Frame1.hwnd
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
|