473,320 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Textbox question

Is there a easy way to stop a textbox receiving focus ? if so how ?
Nov 17 '05 #1
2 1395
Hi CobraStrikes,

You could use a Label, set BackgroundColor to the same as a TextBox and use a Fixed3D border. This is probably the simplest.

You could also handle the Enter event of the TextBox and pass the focus on to the next control in the tab order

private void textBox1_Enter(object sender, System.EventArgs e)
{
Control c = textBox1;

// find the next control in the tab order until
// we encounter one that can be selected
do
c = this.GetNextControl(c, true);
while(!c.CanSelect && c != textBox1);

c.Focus();
}

On Fri, 30 Sep 2005 13:34:08 +0200, <Co**********@al.com> wrote:
Is there a easy way to stop a textbox receiving focus ? if so how ?


--
Happy coding!
Morten Wennevik [C# MVP]
Nov 17 '05 #2
WinForms? If so, set the textbox TabStop property to false. However, user
can always click on the Text box to set the focus. Or, set Enabled property
to False.

<Co**********@al.com> wrote in message
news:Qo*****************@newsfe4-win.ntli.net...
Is there a easy way to stop a textbox receiving focus ? if so how ?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
2
by: Devinim ÞÖLEN | last post by:
Hi; I try to fetch data and show in the textbox as follows; .. .. .. .. <asp:XmlDataSource Id="m_ChXmlDataSource" runat="server"...
3
by: Henry | last post by:
Hi. I've also posted this at another discussion board and here is the original question. ------------------------- "I have this problem and I don't know what I can do. First of all, I have a...
2
by: Jon | last post by:
Hello All, I have a datalist whose itemtemplate contains a label and a textbox. The label text is set on itemdatabound with the text, which is a question, from the database column. Each question...
0
by: jason | last post by:
Hello everyone. I am trying to write some custom command events into a DataGrid. The command that is currently giving me trouble is an "Add" custom command in the footer of a template column. ...
1
by: melanieab | last post by:
Hi, If there's a textbox and the text entered is longer than what's visible (the textbox length), how do you make it so that the beginning chunk of text is visible (instead of the last part of...
13
by: WALDO | last post by:
I have a .Net TextBox (TextBoxBase, really) in which I am appending about 20 lines of text per second. I use the AppendText() method to accomplish this. This is a great substitute for taking the...
1
by: rn5a | last post by:
I want to create a custom control that encapsulates a Button & a TextBox. When the Button is clicked, the user is asked a question using JavaScript confirm (which shows 2 buttons - 'OK' &...
10
by: garyusenet | last post by:
I have a multiline textbox. The size of the text box should be 75 characters wide, and 5 lines in height like this: - <---75 characters--> <---75 characters--> <---75 characters--> <---75...
4
by: Randy | last post by:
My situation is that I have a form on which a number of textboxes and comboboxes are added dynamically based on interaction with the user. As these controls are added, they are given names based on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.