textbox

Styling a TextBox with IDataErrorInfo in WPF

Hello, I'm trying to change style a text box. By now, I have made that my textbox shows an asterisc on the right of its border with this code: <Style TargetType="{x:Type TextBox}"> <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate> <Grid> ...

Clearing default contents of textbox on focus with jQuery

I have a loginbar that can be used to login to 2 different systems depending on what value a user chooses from a dropdown. And then, I provide default values to fill each textbox depending on which login is chosen by the user. However, to make things easier for the user by clearing the default contents when the textbox receives focus, an...

how to restrict the length of entries in text box to its width

c#: By default text box accepts n number of entries, I want to restrict the entries to its width Is there any property in text box through which i can achive this, ...

TextBox Control wont update source through databinding

I'm trying to do a simple Databinding between a string property of an object instance, and a TextBox control. The string property has both get and set accessors, yet the source object does not implement INotifyProperty changed. This does not matter though as I'm not concerned with the object updating the text, but rather only changes to ...

create textbox one by one on enter keypress event

am using c# vs-2005 am on project to create textbox one by one on form1 and am success on button click event my code is below. // declare location point of textbox on Global Area. private point txtboxstartpoint=new point(10,10); private void button_click (Object sender,EventArgs) { Textbox tbx = new TextBox(); tbx.Location= txtbox...

Using a TTimer For Adding Letters On a TextBox

I want to know how can I use a TTimer object to do an infinite loop, that should add the letter N on a TextBox every second. But without freezing the application. ...

Retrieving the new updated value of a Textbox in a ListView when Update linkbutton is clicked.

I am unable to get the updated value of textbox within a listview when "Update" link button is clicked which calls a function. <asp:ListView ID="_lvCartItems" OnItemUpdating="CartPartItem_OnItemUpdating" OnItemDeleting="CartPartItem_OnItemDeleting" runat="server"> <LayoutTemplate> <table width="90...

how to fix the size of password input field?

my html code is <tr> <td>User ID:</td> <td><input type="text" id="uid" size="20"></td> </tr> <tr> <td>Password:</td> <td><input type="password" id="pass" size="20"></td> </tr> <tr> but the problem is, password textbox length...

ASP.NET Create textbox on fly using javascript

Hi All, I want to create a textbox on the fly (in the comment section im creating). Now I would like your opinion on whats the best solution. I was thinking about using a webmethod and add a textbox control dynamically, but since this requires a call to the server I'm not sure if that's the best option. Or can i also spawn a textbox usi...

Jquery datepicker showing previous date in MVC

Hi, I am using the jquery datepicker function on a mvc Html.Textbox, which is bound to my model, the first time I press my search button it gets the correct date in my model, however if I press search again, it should return a different date from the model but it doesn't - it stays cached as the same date that came the first time. I deb...

How can I programmatically generate keyDown events in Silverlight?

I have 2 textBoxes. First is visible the second is not. When keyDown event fires on first textBox I want to fire the same event on 2nd textBox, so it would react same as if user was typing in 2nd textBox. How can I do that? EDIT: I know you can do this in Windows.Forums and I was hoping that it can be done here too. My goal is to ha...

c#: how to insert string containing new lines into TextBox

c#: how do you insert a string containing new lines into a TextBox? When I do this using \n as the new line character, it doesn't work. ...

How do I simulate Text input to a WPF TextBox?

I want to simulate user input to a WPF TextBox. I want to input a character such that the OnPreviewTextInput event is triggered. I tried setting the Text through the Text property, but this didn't trigger the event: public void SomeFunction() { var textBox = new TextBox(); textBox.Text = "A"; } Can I trig...

Swap input character to WPF TextBox before it is added to the Text

I have a TextBox which I'm using to handle numbers. I therefore only accept [0-9.,]. However, "." is the only valid decimal separator. I therefore only want this in my text, but I want to accept "," too, and swap it with a "." such that the displayed character is a valid one. So - how do I swap an input character? I'm assuming I can fe...

Databinding a datarow on Controls in Panel

Hi, I am making a custom control based on a Panel. The main idea is to bind a datatable to this panel. There are functions for selecting a row + updating, saving and deleting this row in the custom Panel. The only problem is binding the data. I have this function: private void _addBindings() { _src = new BindingSource(...

Executing viewmodels command on enter in TextBox

Hi. I want to execute a command in my viewmodel when the user presses enter in a TextBox. The command works when bound to a button. <Button Content="Add" Command="{Binding Path=AddCommand}" /> But I can't bring it to work from the TextBox. I tried an Inputbinding, but it didn't work. <TextBox.InputBindings> <KeyBinding Command="{...

C#: why is text in textbox highlighted (selected) when form is displayed?

I have a form containing a textbox in C# which I set to a string as follows: textBox.Text = str; When the form is displayed, why does the text in the texbox appear highlighted/selected? ...

c#, Textbox.Text encoding

Hi! I have code: string text = sampleTextBox.Text; and I'm wondering in what encoding text is? Is it utf16 (as it is string) or maybe it is my operating system encoding? ...

Writing huge amounts of text to a textbox

I am writing a log of lots and lots of formatted text to a textbox in a .net windows form app. It is slow once the data gets over a few megs. Since I am appending the string has to be reallocated every time right? I only need to set the value to the text box once, but in my code I am doing line+=data tens of thousands of times. Is ther...

Centering text (vertically) inside a textbox using CSS

Hi all, I'm currently working with a textbox that has a background. I was wondering if it's possible to center text (vertically) inside the textbox. important: it's perfectly centered in firefox. Only IE it writes it too high for some reason. I've tried line-height, padding, and margin. Nothing works. Any ideas? EDIT: This is my curre...