textbox

C# Auto Clearing Winform Textbox

I have a user that want to be able to select a textbox and have the current text selected so that he doesn't have to highlight it all in order to change the contents. The contents need to be handle when enter is pushed. That part I think I have figured out but any suggestions would be welcome. The part I need help with is that once...

C# Include Derived Control in Toolbox

This is in reference to my other question Auto Clearing Textbox. If I choose to derive a new TextBox control from TextBox instead of implement a user control just containing my Textbox, how would I include that in the toolbox. ...

How do I set a textbox to multi-line in SSRS?

I have a report with many fields that I'm trying to get down to 1 page horizontally (I don't care whether it's 2 or 200 pages vertically... just don't want to have to deal with 2 pages wide by x pages long trainwreck). That said, it deals with contact information. My idea was to do: Name:        Address:   City:        State:  ... Jon D...

What is a reasonable length limit on person "Name" fields?

I have a simple webform that will allow unauthenticated users to input their information, including name. I gave the name field a limit of 50 characters to coincide with my database table where the field is varchar(50), but then I started to wonder. Is it more appropriate to use something like the Text column type or should I limit the ...

How do I hide the input caret in a System.Windows.Forms.TextBox?

I need to display a variable-length message and allow the text to be selectable. I have made the TextBox ReadOnly which does not allow the text to be edited, but the input caret is still shown. The blinking input caret is confusing. How do I hide it? ...

Prevent Multi-Line ASP:Textbox from trimming line feeds

I have the following webform: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestWebApp.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="serve...

How do I get an auto-scrolling text display on .NET forms - e.g. for credits

Need to show a credits screen where I want to acknowledge the many contributors to my application. Want it to be an automatically scrolling box, much like the credits roll at the end of the film. ...

How can I show scrollbars on a System.Windows.Forms.TextBox only when the text doesn't fit?

For a System.Windows.Forms.TextBox with Multiline=True, I'd like to only show the scrollbars when the text doesn't fit. This is a readonly textbox used only for display. It's a TextBox so that users can copy the text out. Is there anything built-in to support auto show of scrollbars? If not, should I be using a different control? Or do...

How to retrieve a changed value of databound textbox within datagrid

Hi, ASP.NET 1.1 - I have a datagrid on an aspx page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable...

.NET NumericTextBox

Does anyone know why Microsoft does not ship a numeric text box with its .NET framework e.g. a text box which would ensure that the characters entered are always a valid number? It's something which is commonly used across applications of different flavours and indeed something which most GUI libraries (well, those that I know) deliver i...

Dynamically add CalendarExtender to Textbox subclass server control?

I'm trying to create a server control, which inherits from TextBox, that will automatically have a CalendarExtender attached to it. Is it possible to do this, or does my new control need to inherit from CompositeControl instead? I've tried the former, but I'm not clear during which part of the control lifecycle I should create the new in...

Automatically select all text on focus in WinForms TextBox

When a C# WinForms text box receives focus, I want to select all the text in the textbox. To see what I mean, click in your web browser's address bar. See how all text was selected? I want to do that. FASTEST GUN ALERT: please read the following before answering! Thanks guys. :-) Calling .SelectAll() during the .Enter or .GotFocu...

Calculate text width with Javascript

I'd like to use Javascript to calculate the width of a string, is this possibly without having to use a monospace typeface? If it's not built in my only idea is to create a table of widths for each character but this is pretty unreasonable especially supporting unicode and different type sizes (and all browsers for that matter). Thanks...

ASP.NET TextBox control with label text in the background

I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then these words appear agai...

Position the caret in a MaskedTextbox

I would like to be able to override the default behaviour for positioning the caret in a masked textbox. The default is to place the caret where the mouse was clicked, the masked textbox already contains characters due to the mask. I know that you can hide the caret as mentioned in this post, is there something similar for positioning ...

How Do I Give a Textbox Focus in Silverlight?

In my Silverlight application, I can't seem to bring focus to a TextBox control. On the recommendation of various posts, I've set the IsTabStop property to True and I'm using TextBox.Focus(). Though the UserControl_Loaded event is firing, the TextBox control isn't getting focus. I've included my very simple code below. What am I missi...

Any way to make a WPF textblock selectable?

I want to make the text displayed in the Witty, an open source Twitter client, selectable. It is currently displayed using a custom textblock. I need to use a TextBlock because I'm working with the textblock's inlines to display and format the @username and links as hyperlinks. A frequent request is to be able to copy-paste the text. In...

Where can I find an AutoComplete TextBox code sample for Silverlight?

I've searched around for a while today, but I haven't been able to come up with an AutoComplete TextBox code sample for Silverlight 2 Beta 2. The most promising reference was found on nikhilk.net but the online demo doesn't currently render and after downloading a getting the code to compile with Beta 2, I couldn't get the Silverlight p...

How do you add a superscript character into a Powerbuilder textbox?

Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox? ...

Adjusting the auto-complete dropdown width on a textbox

I am using a textbox in a .NET 2 winforms app that is setup with a custom AutoCompleteSource. Is there anyway through code that I can increase the width of the list that appears containing the auto complete suggestions? Ideally I would like to do this without increasing the width of the textbox as I am short for space in the UI. ...