textbox

C# Input validation for a Textbox: float

This supposedly easy task gave me some headache. I simply want to let the user enter any text that succeeds float.TryParse into a Textboxish control. I could use a normal TextBox and check the Text in some btnOK_Click, but this is obviously lame. Also, there is a nice built-in MaskedTextBox control, but I failed to set it's mask to be e...

access textbox from anywhere in application

Hi, How can I make a textbox in my winforms application that accepts new lines of text from anywhere in the application? I have a main form that contains a textbox. I'd like to directly add text to the box from a method in another class. Update I tried this in my main form: public void Output(String value) { if (txtOut...

WPF doesn't honor Textbox.MinLines for Auto height calculation

I want to have a TextBox which Height grows as Iam entering lines of Text. I've set the Height property to "Auto", and so far the growing works. Now I want that the TextBox's Height should be at least 5 lines. Now I've set the MinLines property to "5" but if I start the app the TextBox's height is still one line. ...

WPF Font: Why are some characters missing?

I'm writing a WPF app and the font that I am using only has problems running in WPF - it works fine using it in anything else (notepad, wordpad, etc.). The problem with WPF is that it falls back to another font sometimes. By "sometimes" I mean that only characters [a-zA-Z] appear to render correctly - everything else appears to be rend...

Why does a read-only textbox does not return any data in ASP.NET?

I've set a textbox to read-only. When the user clicks on it, a calendar is displayed and the user selects the date which inputs into the read-only textbox. But when I try to enter the data into the database, it shows null value. What is wrong? ...

Watermark TextBox in WPF

How can I put some text into a textbox which is removed automatically when user types something in it? (In WPF) ...

creating dynamic textboxes with 'paging'

based on the solution here: http://stackoverflow.com/questions/827175/entering-values-into-database-from-unlimited-dynamic-controls i could successfully create dynamic asp.net controls at runtime. so if the user enters 10, it displays 10 textboxes and if the user enters 50 it displays 50. so far it's good. but 50 textboxes would make th...

WPF TextBox not accepting Input when in ElementHost in Window Forms

We are developing a UI Control in WPF to be consumed within an existing Windows Forms / MFC application engine (Rhino 3D). The application engine exposes the ability create a "Dockbar" which essentially lets you put Windows Forms controls inside a child window which can dock to the Engines Interface. I am attempting to put a simple WPF...

.net mvc 1.0 Html.TextBox

I have following code which only works for first time page is hit. <%= Html.TextBox("Amount",Model.Amount)%> In above line, debugger shows property calls to get Model.Amount each time the view is being generated. But updated value of Amount is not reflected in generated HTML. Help ...

Prevent paste of html page from clipboard into text box in c# ASP

I have a simple web user input form using c#. Users copy what they thin is a screen shot of error conditions to submit as input to the form. The copy action actually captures the HTML of the error page. When this is pasted into my test box I get an error (A potentially dangerous Request.Form value was detected from the client (tbxComm...

Create rectangular text selection

Hello i trying to figure out if it is possible to do rectangular text selection (like in Jedit) in standard textbox control in c#? ...

How can I change textbox style in a textbox style data trigger?

I have created a default style for my textbox controls, but I would like to be able to change the style at runtime. I have a property that I want to bind to that informs the UI if the data is mandatory or not, and I want to be able to change the style of the textbox to another style that displays a red line under the textbox. I can't u...

Select text from multiple textboxes simultaneously

i have 10 textboxes and i need to select text from each one of them. The problem is that i cant select text from multiple textboxes. Is there any solution for this problem my code is. private void Form1_Load(object sender, EventArgs e) { createTextBoxes(10); ((TextBox)textBoxes[0]).Select(1, 4); ((TextBox...

in C# can I explicitly set height of font and/or adjust whitespace width between lines of multiline textbox?

I want to implement my own textbox (editor) with line numbers to the left of it. Well, so I am implementing the line numbers in another, narrow multiline textbox. However, I want to be able to adjust the font in the main editor and generally make it to be big size, whereas I don't want to have the line numbers to be of equally big size f...

how to trigger a set commands when user setfocus on a text box in a website using c#.

i have a username textbox and a password textbox in the webpage. i want username textbox to read the following code once it has lost focused/ when the user clicks on the password textbox? so that the password is automatically displayed in the password text box. String cookiename = usernameTextBox.Text; //grab cookie HttpCo...

ASP.NET Display Selected Items from Listbox in Textbox

I'm trying to display all selected items from a listbox into a textbox. Currently I'm doing the following without success: For i As Integer = 0 To lb_words.ListCount If lb_words.Selected(i) = True Then tb_text.Text &= " Presto" End If Next What should be happening is that for every selected item in my listbox (lb.words...

Programmatically Search an Access Listbox control's Items Based Off of a Textbox Entry

I don't know if this is possible, but I am trying to code an Access textbox that will act as a search engine entry control for a database. Specifically, I wanted to add mulitple, non-visible, listboxes to a form, and have them filled with table or query data. When ever an end-user enters a search word in the textbox and presses search,...

How to make a TextBox non-interactive in C#

Hey, I've got a TextBox on a form that I am using to just display data. I have set it to ReadOnly which stops the user from changing the data displayed in the TextBox. Although the user can still highlight the data in the TextBox, how do I disable this? NOTE: I know using a label would be much easier, although for some reason the lab...

How to convert date in Text box to MySQL DATETIME format

Hi, I'm quite new to php and have been reading Larry Ullman book to develop a basic db site. I have used the YUI Calendar pop up date picker to add a date to a text field called"date". The date format it enters is eg Thursday, 7 May 2009 I have tried many different ways to try and enter the date in to mysql db but it remains at 00 00 00...

How To load data that are accessed from database to html form.

I am trying to access data from table with GetString() method and that data is stored in some variable then it must be loaded to html form when i am click the submit button. How to it? Please help me...... ...