i have two textbox's... these textbox's can have formatting applied etc, but they lose focus when a button is pressed, and the wrong textbox has formatting applied..

is there a way to track the last textbox to have control?.

some kind of for each control f type textbox, if mouse.click, this.textbox.focus = true?

i've seen examples on the net, but they didnt work for me.

any help is appriciated..

thanks.

When a button is pressed, the focus will be moving on to button,
you can do this,
once the operation on button_click is done, before the event exits, based on your logic call the last line for either textbox1.focus(); or textbox2.focus();
this should be a simple option.

solved. i just added a variable textboxfocus. then in the Enter event of each textbox i set it to true or false accordignly.

textbox1_enter( bla bla)
{
textboxfocus1 = true;
textboxfocus2 = false;
etc..
}

then in my bold, itallics section, i just use if statements to calculate which textbox last had focus.

may not be perfect, but it works.

thanks guys.

This question has already been answered. Start a new discussion instead.