textbox

C#: How to make pressing enter in a text box trigger a button, yet still allow shortcuts such as "Ctrl+A" to get through?

Sorry for the long title, but I couldn't think of another way to put it. I have this: private void textBoxToSubmit_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { buttonSubmit_Click((object)sender, (EventArgs)e); } } ... in order to make pressing enter in the tex...

ASP.NET Multiline textbox allowing input above UTF-8

In my web.config I have <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="de-DE" /> In my page directive I have ResponseEncoding="utf-8" Yet for some reason an ASP TextBox with the TextMode="MultiLine" allows inputs of characters outside of UTF-8. When I paste...

WinForms Clearing multiple Textboxes with one command

I have several textboxes in a form, and have a button which inserts all the values in a Database and I have to clear the content of all the textboxes and focus to the first one right after pressing the button. Now I can easily do that using the Clear method of each of the textboxes but it takes 10-12 lines of code just for that. Can I d...

current line number changed event if vb.net

How can I do some code when the user changes what line the caret is on? so something like: sub textbox1_lineindexchanged (byval ....) Handles Textbox1.Lineindexchanged 'do code based on the current line end sub sorry, I am using a richtextbox, just I always used it so I just call it a textbox in my thoguhts. ...

Photoshop Action to insert text with a box around it

I have a 92 page catalogue (one image per page, multiple products per image) and no product codes on the image for each product. Does anyone know of a photoshop action to allow entry of a stock code (<15chars text), that will create a filled, outline box with the text inside? It will be awful to have to do them by hand - there are hund...

Possible to Change TextBox Style When Input Changes? (Stylesheet/Macro?)

Is it possible to create a macro or stylesheet so that when a TextBox text area is empty, it is yellow per se and when it has data it is white. I would like to accomplish this without having to explicitly call the TextChanged event. ...

How to attach OnClick event for a javascript generated textbox?

I have a table row which contains a textbox and it has an onclick which displays a javascript calendar... I am adding rows to the table with textbox, but i dont know how to attach onclick event to the javascript generated textbox... <input class="date_size_enquiry" type="text" autocomplete="off" onclick="displayDatePicker('attendanceDa...

Insert character at start of current line (vb.net)

Currently I have the code: textbox1.text = textbox1.text.insert(textbox1.getfirstcharIndexFromCurrentLine(),";") But this means it has to reload the entire textbox, which with large files is noticeable slow. What are the alternatives? ...

Clicking on scrollbar causes unintential firing of event

Morning - I'm having a little problem. I have an autocomplete extender textbox where a user types in words and suggestions are provide. Should the term be rather generic, a list appears and the user can scroll up or down using the mouse wheel with no problems at all. However, if the user attempts to click on the scroll bar and scroll t...

disabling property of a textbox

hi friends, when i click on a text box or start typing in a text box, its showing the previously entered string below it, i want to disable this property of a text box, how can i do this? please help me Thanks ...

vb6 xml string to textbox

Can anybody help me to create function that will accept for parameter xml string and return a formatted string as response that after can Example: <cars> <ford> <model>fiesta</model> <model>focus</model> </ford> <renault> <model>twingo</model> <model>clio</model> </renault> </cars...

How to control placement ordering when using arrangeoverride to extend WPF controls

I am extending the WPF textbox in order to place a custom image on it. I want to capture mouse clicks on this image. So far i have been able to use arrangeOverride to place the image in where i need it but since it happens to be placed "inside" the text box, whenever i try clicking it the text box captures the click and the event that is...

Database table search using text box and dropdown list with ASP.net/C#

I'm building a small website using ASP.net/C# and I wanted to know how to implement a simple search feature using a text box and a dropdown. The datasource is a products table and in the text box I enter the product's name and in the dropdown are the categories. (I have managed to populate the dropdown with the available categories alre...

Allow certain characters in certain positions in text box (vb.net)

For example I only the second character in each line to be an x, while the 3nd to 10th character must be a hex digit. At the moment I use a Select Case, then check the position of the caret (using textbox.selectionstart) and see if the key being pressed is a "legal" character. Is there a better way of doing this as it slows down on larg...

WPF TextBox Mask to hide decimals if they are not there

I am using a WPF TextBox editor to display a decimal value with 2 decimal places. If i go into the TextBox, and put in the value 27.5, the textbox shows 27.50. My current mask = "{}{double:5.2}". Is there any way to hide the decimal places if there is no value there? like 52 instead of 52.00? ...

How can I access textbox properties in a custom validator?

I want to build a custom validator control that inherits from BaseValidator. It will only be used on textboxes in my asp.net application. How can I get access to the textbox itself (read properties of the textbox) within the custom validator? Here is what I have in my EvaluateIsValid function: Dim t As TextBox = CType(Page.FindCon...

How to read text that is present in text box of MS word document?

Hi, I have an word document which I want to convert to text (.txt) file programmatically. I am using C# for this. I am able to read paragraphs and tables from word document and convert them to text. There are some textboxes in the word document and those textboxes contain text that I want to read and put them in text file. My problem is ...

ProcessCmdKey doesn't trap event in usercontrol

I'd like to handle the Enter button in my TextBox inside ListBox in UserControl (not Form!). There are a lot of answers and samples for the case. The most common is to override ProcessCmdKey() or IsInputKey() in CustomTextBox inherited from TextBox: public class CustomizedTextBox : System.Windows.Forms.TextBox { protected override b...

MVVM and the TextBox's SelectedText property.

Hi all. I have a TextBox with a ContextMenu in it. When the user right clicks inside the TextBox and chooses the appropriate MenuItem, I would like to grab the SelectedText in my viewmodel. I have not found a good way to do this the "MVVM" way. So far I have my appliction utilizing Josh Smith's way of MVVM. I am looking to tranfer...

jQuery textbox.val('xxxx') not causing change to fire?

I have the following jQuery code in place on my page: var isChanged = false; $(document).ready(function() { $('.change').change(function() { isChanged = true; }); }); I am using a plugic that modifies the value of the text box it is linked to using: target.val('xxxx'); the text box in the html (from asp.net) is: <i...