i want to focus the text box after the click in the textbox or heilight he border of textbox
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ramchand RepallePosted Jan 28, 2015, 5:45 AM
you can achieve by applying css styles for input textbox.
http://jsfiddle.net/ramchandr/ptdrwwz1/
The aforesaid Jsfiddle helps you to achieve that..
Thanks,
Ramchand
Indian CareersPosted Jan 28, 2015, 9:36 AM
use the same code below
and don't forget to give tab index in order for the textboxes
code :
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Focus();
}
}
}
Karan GuptaPosted Jan 28, 2015, 9:18 AM
Karan GuptaPosted Jan 28, 2015, 9:13 AM
Ameer BashaPosted Jan 28, 2015, 7:08 AM
Textbox1.focus();
Afzaal Ahmad ZeeshanPosted Jan 28, 2015, 5:46 AM
Secondly, for us to work on it and help you out, you need to provide the code you're using and the framework you're using also matters, changing the border in ASP.NET is totally different as compared to changing the border in WPF or Win Forms etc. In ASP.NET you can use the CSS styling techniques to change the border of the TextBox (in HTML form it is an input element), whereas in WPF or Win Forms you need to change the parent property of the TextBox (that is the Border which wraps it).
Have a look at this MSDN link for more on this topic: https://msdn.microsoft.com/en-us/library/system.windows.controls.textbox(v=vs.110).aspx