textbox

C#, Get other application text from TextBox and TextArea?

Good morgning, I would like to be able to analyze text where I am writting whatever the application I am. Example, If I am here, typing in this TextArea, I would like to be able to get the text, same way if I were in the Subject Textbox in my Outlook. I have search Google without success, maybe it's because it require Win32API call. T...

AutoPostback with TextBox loses focus (question made clearer)

A textbox is set to AutoPostback as changing the value should cause a number of (display-only) fields to be recalculated and displayed. That works fine. However, when the field is tabbed out of, the focus briefly moves on to the next field, then disappears when the page is redrawn so there is no focus anywhere. I want the focus to be o...

C# : Textbox multiple line and blank line disappear

I have a Winform application build with C# and .Net 2.0. I have a textbox set with MultiLine. The problem is when someone write text with multiple line (press few enters) and press my save button than close and load the form again. All the new line disappear (the text is there at least). Example: Line1 Line3 This will be if I save ...

Phone Number Formatting, OnBlur

I have a .NET WinForms textbox for a phone number field. After allowing free-form text, I'd like to format the text as a "more readable" phone number after the user leaves the textbox. (Outlook has this feature for phone fields when you create/edit a contact) 1234567 becomes 123-4567 1234567890 becomes (123) 456-7890 (123)456.7890 bec...

Force ASP.NET textbox to display currency with $ sign

Is there a way to get an ASP.NET textbox to accept only currency values, and when the control is validated, insert a $ sign beforehand? Examples: 10.23 becomes $10.23 $1.45 stays $1.45 10.a raises error due to not being a valid number I have a RegularExpressionValidator that is verifying the number is valid, but I don't know how t...

How can I force input to uppercase in an asp.net textbox?

I'm writing an asp.net application. I have a textbox on a webform and I want to force whatever the user types to upper case. I'd like to do this on the front end. You should also note that there is a validation control on this textbox, so I want to make sure the solution doesn't interfere with the asp.net validation. Clarification: It a...

Visual Studio GUI is see-through?

I'm having some trouble with Visual Studio 2008 on my Windows XP SP2 laptop. What happens is that when I start a program with a few textboxes and stuff like that, the boxes are see-through. I can litteraly see through them and see what's on the underlaying screen. Like if I only have this Form showing and behind that my wallpaper, I can...

Data-bound TextBox: can't exit

Hi, I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case - when editin...

XAML - TextBox Linebreak

Is there anyway in XAML only to have a linebreak in a TextBox? I know I can set myTextBox.Text = "something\r\nsomething2" in Code, but I can't do this: <TextBox x:Name="myTextBox"> <TextBox.Text> Something <Linebreak/> Something2 </TextBox.Text> </TextBox> or this <TextBox x:Name="myTextBox" Text="so...

ASPX Textbox: Execute method on return keypress

I have a search box that doesn't have a submit button, I need to be able to hit enter and then execute a method, how do I do this? ...

How to retrieve data from dynamically added textboxes?

Im adding textboxes (not a fixed number of textboxes) dynamically to a form on ASP.NET page, how do i read back data from these textboxes? ...

XAML : Binding textbox maxlength to Class constant

I am attempting to bind a WPF textbox's Maxlength property to a known constant deep within a class. I am using c#. The class has a structure not too dissimilar to the following: namespace Blah { public partial class One { public partial class Two { public string MyBindingValue { get; set; } ...

eliminate the enter key after pressing it in the keyup event of a textbox.

How to cancel a keypress event in a textbox after pressing the return key. ...

C# refreshing textbox from BindingSource

I am having difficulty refreshing windows forms controls that are using a BindingSource object. We have a CAB/MVP/SCSF client that I (actually “we” since it is a team effort) are developing that will interact with WCF services running on a remote server. (This is our first attempt at this, so we are in a learning mode). One of the cal...

ASP.NET : Binding textbox maxlength to Class constant in HTML

I am attempting to allow my web designers to use the metadata we have about database fields in the asp.net pages they are creating. The most obvious one is as follows: <asp:TextBox runat="server" id="txTextBox" MaxLength="<Value From Metadata here>" ... /> All the required metadata is stored in our class objects and is accessible due ...

Locking down valid characters in a Textbox

I need to be able to lock down the valid characters in a textbox, I presently have a regex which I can check each character against such as [A-Za-z] would lock down to just Alpha characters. protected override void OnKeyPress(KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Back) { base.OnKeyPress(e); return; } ...

How do I highlight a selection made programmatically in a Winforms TextBox

I've not gone into much research here, but the intuitive thing is not working: private void SerachButton1_Click(object sender, EventArgs e) { String serchTerm = searchTerm1.Text; String text = usualTextBox.Text; Int32 index = text.IndexOf(serchTerm); if (index >= 0) { usualTextBox.Select(index, serchTerm.Length);...

Detecting changes to the source data using the XmlDataProvider and a bound TextBox

I have a TreeView bound to an XmlDataProvider. The name of a node is reflected in the tree and the data of the node is in a TextBox. When you click on a tree item, it loads the data in the TextBox. What is the best way to determine when a user has changed the source data referenced by the XmlDataProvider. I would like to put an aster...

How to create a numeric textbox in Silverlight?

As the title says really. I've had a look at inheriting from TextBox, but the only sensible override was "OnKeyDown", but that just gives me a key from the Key enum (with no way to use Char.IsNumeric()). ...

Enter button does not submit form (IE ONLY) ASP.NET

I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail: function checkEnter(e){ var characterCode if (e && e.which) { e = e cha...