views:

392

answers:

5

When I load my form the focus is set on first control which is textbox. the data is not fully visisble in the textbox. this problem happens to textbox only and when the focus is set on first time.if someboy know abt the solution then pls let me know.

A: 

it's a windows form, so the controls are wincontrols. i m trying to load a page from another page, something like selecting a row from first page n then passing the data to second page. when second page loads the focus sets on the first control based on the tab index. i have 4 controls and the first one is textbox, so the focus sets on it. the text is not fully visible(starting characters r not visible, user needs to use left arrow key to reach to first char) if the text length is greater tahn 5 character. textbox size is 149, 20. i hope this info wud be useful, pls let me know if u need someother info.

A: 

After your clarifications I assume that there are some trailing blanks in your data. Try to trim the text before you assign it to the textbox.

splattne
A: 

If i don't set the focus the text is fully visible, so i assume that it is issue related to focus. i m using databinding method to bind the text to textbox, which should not be a problem.

A: 

i checked it there is not trailing space/blanks in data.

+1  A: 

If I understood ok, you set the focus, which selects entire text and places the cursor to the end?

In that case set the SelectionStart property to 0 after selecting it:

 yourTextBox.SelectionStart = 0;
Groo