按钮(保持“向上”或“向下”)
我需要放置一个 form 3 按钮,当我单击该按钮时,将其显示为按下,其他按钮向上,当我单击另一个按钮时,它应该为“向下”,其他按钮应为“向上”
I need to put on a form 3 buttons and when I click on the button to display it as pushed and the others to be up, when I click another button it should be "down" and the others "up"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所有按钮的属性“Groupindex”必须设置为相同的数字,但不能等于 0。使用AllowAllUp,您可以确定是否允许它们全部打开。
至少在 Win32 的 Delphi 2006 中是这样的。
All your Buttons must have their Property "Groupindex" set to the same number, but not equal 0. With AllowAllUp you can determine wether they're allowed to be all up or not.
At least that's how it is in Delphi 2006 for Win32.
Remus,我不是 Delphi 人员,但您描述的概念称为单选按钮。我确信 Delphi 有类似的内置功能。另请注意,默认情况下单选按钮可能看起来像复选框(方形或圆形),但应该有一个属性/属性,您可以调整它们以使它们看起来像带有“的按钮”按下”状态。
某处开始...
Remus, i'm not a Delphi guy but the concept you're describing is called Radio Buttons. i'm sure that Delphi has something like that built in. Also note that radio button by default might look like check boxes (square or circular) but there should be a property/attribute that you can adjust to make them look like buttons with "pressed" states.
Somewhere to start...