Notifications
Clear all
[Closed] rollout controls question
Jan 08, 2014 12:01 am
Using a simple rollout button as an example
rollout RO "Rollout"
(
button btn "Button" width:100
)
createDialog RO
RO.btn.name
RO.btn.text
RO.btn.pos
RO.btn.width
Everything else there works, but the last line throws an error. So, is there any way to get/set the width of a rollout control like that after the dialog is created?
4 Replies
Jan 08, 2014 12:01 am
Some controls can, but not ‘button’. Use a dotnet button instead if you need this functionality.
1 Reply
Yup. This works
try(DestroyDialog ::RO)catch()
rollout RO "Rollout"
(
fn dnClr r g b = ((dotNetClass "System.Drawing.Color").FromArgb r g b)
dotNetControl btn "Button" pos:[5,5] width:100 height:20
on ro open do
(
btn.text = "test_button"
btn.backcolor = dnClr 150 20 20
btn.forecolor = dnClr 220 220 220
btn.FlatStyle = btn.FlatStyle.Flat
btn.FlatAppearance.BorderSize = 0
)
)
createDialog RO 110 30 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
/*
-- test with this
RO.btn.text = "my_button"
RO.btn.pos = [0,0]
RO.btn.width = RO.width
RO.btn.height = RO.height
Jan 08, 2014 12:01 am
There is an example of Denis of how to change the size of the rollout controls.
I remember that Swordslayer showed different way of changing the size of the buttons, bur can’t find the thread.