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

???????????????????????

?????????????????????????????????

????????????///?!??????!??!??????????????!!!!!!!!!!!!!!!111

commented: there is no need for this +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.

thenks its work!!!!!!!! :):):)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.