0

I made this code:

private int a;
private int b;
 
private void Form1_Resize(object sender, EventArgs e)
{
    adrBarTextBox.Width = b + this.Size.Width - a;
}
 
 
private void Form1_ResizeBegin(object sender, EventArgs e)
{
    a = ((Form)sender).Size.Width;
    b = adrBarTextBox.Size.Width;
}

when i open the program and i maximize the window the combobox become huge and you need to click at the arrow at right.

but if i open the program and i moving the window and after that maximize the window its work grate

you can see here at the video i made:
http://www.youtube.com/watch?v=g2FrwPhwDvc

thanks

3
Contributors
7
Replies
8
Views
6 Years
Discussion Span
Last Post by Geekitygeek
0

The reason is that when you do the first resize only the Form1_Resize method is being called so your 'a' and 'b' variables are equal to zero. Set them somewhere else, like in the Form_Load event.

Also, replying to your own thread over and over again makes it less likely that someone will read it as they assume that others are helping you and will only read it if the topic is of interest to them.

Edited by Momerath: n/a

0

Solvers will post when they can..we aren't paid to answer at your beck and call so be patient. Buping your thread like this will only make it less likely that you will receive help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.