Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to do this?
Message
 
 
To
13/12/2000 22:06:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00453170
Message ID:
00453221
Views:
24
Alex,

one more try *g*

Here's the opg.Init()
bOptionGroup::Init()

set classlib to ccontrol additive

for each oButton in this.Buttons
   lcName = "lbl" + this.Name + oButton.Name
   this.parent.AddObject( lcName, "opgLabel", this, oButton )
   loLabel = eval( "this.parent." + lcName )
   with loLabel
      .Visible = .t.
   endwith
endfor

* Here's the opgLabel code:

* Init()
lparameter oOptionGroup, oButton

local lnWidth

with this
   .Top = oButton.Top + oOptionGroup.Top + 1
   .Left = oButton.Left + oOptionGroup.Left + 25
   .mcSetValue = left( oButton.Caption, 1 )
   .mcOptionGroupName = "this.parent." + oOptionGroup.Name
   .mcButtonName = .mcOptionGroupName + "." + oButton.Name
   .Caption = substr( oButton.Caption, 2 )
   lnWidth = oButton.Width
   oButton.AutoSize = .f.
   oButton.Caption = .mcSetValue
   oButton.Width = lnWidth
endwith

* Click()
local loObject

loObject = eval( this.mcOptionGroupName )
loObject.Value = this.mcSetValue

loObject = eval( this.mcButtonName )
loObject.SetFocus()
You should be able to tweak it and use the hotkey on the label and the value to store.

>Sounds like a perfect class for the situation. Would you share it? Could it be changed it so that the HotKey, if any, becomes the value stored?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform