|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I hope this is the correct place to post this thread.
Visual C# is the name, and getting the blinking cursor in a textbox is the game. How do I set the focus on the textbox after I've done some other stuff in my app.? I've tried txtBarcode.Focus(); ...doesnt work txtBarcode.Select() ...nothing txtBarcode.bringToFront() ...nada txtBarcode.Enable ...same thing Anyone with experience with this? Thanks in advance for any help / suggestions... ![]() |
|
#2
|
|||
|
|||
|
Quote:
Hi, I've tryed and tested, this must work; Set the tapindex = 0 TextBox1.Focus(); Tryed again, sparrow1 |
|
#3
|
|||
|
|||
|
Quote:
I hope this is ASP.net; Write following function in your codebehind and for every control call this function private void Set_Focus(string controlname) { string strScript; strScript = "<script language=javascript> document.all('" + controlname + "').focus() </script>"; RegisterStartupScript("focus", strScript); } |
|
#4
|
|||
|
|||
|
Quote:
Try with txtBarcode.ScrollToCaret() ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Setting textbox focus in C# |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|