Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug with controls location and scrollbars in a Windows Form

1 view
Skip to first unread message

Tophe

unread,
Mar 12, 2010, 11:04:58 AM3/12/10
to
Hi,

I've noticed a bug with WinForm and scrollbars, and I would like to
know if there is a workaround ...

Bug description :
------------------------
1) create a win form, and add 3 buttons :
* FirstButton : upper left corner of the winform
* SecondButton : location = (0 ; 600)
* ThirdButton : location = (100, 600)

2) Set : ThirdButton.Visible = false

3) Set the Form size to 100 x 100 ... and set : AutoScroll = true

4) Add the following event handler to the Click event of FirstButton
and SecondButton ...

private void OnButton_Click(object sender, EventArgs e)
{
this.ThirdButton.Visible = true;
}

Now is the trick :
- if you click on FirstButton ... the ThirdButton will be displayed to
its right location

- if you scroll to SecondButton and click on it, ThirdButton is
displayed to a wrong location (offset added)


Does anybody know how to solve this issue?
Thanks in advance

0 new messages