|
-
Sep 21st, 2000, 02:07 PM
#1
I have a frame with 3 option buttons indicating types of access (read only/read write/administrative for example).
I need one such frame for each application the users have access to.
I don't know how many applications I have until run time.
I want to dynamically create frames at run time where each set of 3 buttons are independent of each other.
How can I do this?
Thanks for the help!
-
Sep 21st, 2000, 02:49 PM
#2
Okay, I got it to work by creating an activeX control with the frame & 3 buttons.
If there are any other suggestions, they are appreciated.
Also, if I put a label in there, can I change the label caption inside of the frame dynamically?
-
Sep 21st, 2000, 03:10 PM
#3
Frenzied Member
One way to do it
Yes, create a public property called "LabelCaption" as a string. Then assign the value for the property to the label's caption, like this:
Code:
Public Property Get LabelCaption() As String
LabelCaption= Label1.Caption
End Property
Public Property Let LabelCaption(ByVal asNewCaption As String)
Label1.Caption = asNewCaption
End Property
-
Sep 21st, 2000, 04:02 PM
#4
Frenzied Member
Here's another idea
So your user can tell which option button is clicked at runtime (and so they can set the default at runtime) you may want to create an AccessType property that returns the access type currently selected.
This property would return an integer 0, 1, or 2 that indicates which option button is selected. This is assuming that your option buttons are a control array with indexes 0, 1, and 2.
Example:
Code:
' Private variable holds public property value
Private miAccessType As Integer
Private Sub optAccessType_Click(Index As Integer)
' Set private variable = index of selected option button when button is clicked
miAccessType = Index
End Sub
Public Property Get AccessType() As Integer
' Returns index of selected option button
AccessType = miAccessType
End Property
Public Property Let AccessType(ByVal aiNewValue As Integer)
' This allows user to set initial value of option button
' A little error checking may be necessary...only let the user
' select 0, 1, or 2. An incorrect entry simply selects 0
If aiNewValue < 0 Or aiNewValue > 2 Then aiNewValue = 0
miAccessType = aiNewValue
optAccessType(aiNewValue).Value = True
End Property
Hope that helps,
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
|