With Web 2.0 I am trying to adjust the dimensions of a WebButton during Runtime.
First, using the Lock properties seemed to have no effect on the size (neither Width nor Height), only on the position. The size is stuck on the IDE values.
Next, changing the Height property actually changed the height, but not the display. It was stuck at 38px. I did discover that the height could be changed through the WebStyle.Value(“height”) function. So that was solved.
Then I tried to change the Width property, but nothing changed. I then tried the same trick as above by using the WebStyle.Value(“width”) function. But no luck. I cannot change the width during runtime under any method I could think of (LockRight+LockLeft, nor Width property nor WebStyle.Value function).
Create an new empty web project. Add a WebButton to the page. In the Pressed event place the following code. The caption does change as expected, but the display of the button does not modify. Even if you move the cursor around the button it changes appropriately but the actual displayed width is not affected
static flag as boolean
flag = not flag
if flag then
me.Width = 200
else
me.Width = 50
end if
me.Caption = Str(me.Width)