.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

text box key press event

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :Windows Application
Here's a portion of code that I have that takes the inputted text in a text box and sends it to a rich text box when the enter key is pressed:   private void textData_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (e.KeyChar == 13 || textData.Text != null) { richMain.Text += ("\n" + textData.Text); textData.Text.Remove(0, textData.TextLength); } }   Could anyone tell me why this is not working?  Thanks in advance.

View Complete Post

More Related Resource Links

gridview tablecell text emptystring in RowDataBound event when editing


HI and thanks in advance.  asp.net using vb, using a codebehind page.

I have a relatively simple gridview bound to an product table that displays great.  The problem comes when I choose to edit a row.  When I do so, the gridviews' RowDataBound event fires and the values of the text properties of the tablecells in the row evaluate to "" emptystring. 

I do notice that if I break within the GridView1_RowDataBound event during a refresh of the page, the values are there.  But again, when I hit the "Edit" button in the first column (the CommandField column) .  Text properties of the cells resolve to ""

 Here is the code for the event, followed by the gridview in the form (inside an updatepanel)

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then  ' not a header, footer row.. etc.
            Dim cellProductNumber As TableCell = e.Row.Cells(3) ' ProductNumber column

'>>>>> after clicking "update", even though a value displays in the gridview,
' the cellProductNumber.Te

Raise OnPropertyChanged event when Text Box Text has changed

Hi there I have a Wrapped Text Box that is bound to a Public String Property. I have a related OK Button that should be Enabled when the text changes to indicate there are 'items' in the Text Box. The problem is that the set accessor of the property (and thus OnPropertyChanged) is not being called until focus is lost from the text box - and I would like the Ok Button to be enabled before then. What is the the best way to raise the set when the Text Box text has changed? (A List Box is not an option) Thanks very much Joe

catch the html button click event on a class file including html text box value.


I want to catch the html button click event on a class file including html text box value..

<p><input name="" type="text"  value="Enter Name*"/></p>
<p><input name="" type="text"  value="Enter Email*"/></p>

  <input name="Input" type="submit" value="Submit" />

plz tell me how can i do this..

jquery - span text changed event


is there a jquery event that is fired when the text of a span element is changed? The change event does not apply to <span> elements. I see reference to "text changed", but $('#PriceCond').bind('textchange', function(event, prevText) { ... }) ; does not work either.



     <input type="button" id="TestButton" value="Test" />

     <span id="PriceCond"></span>

<script type="text/javascript">
  $(document).ready(function ()

    var clickFunc =
          function ()
            var s1 = $('#PriceCond').text();
            $('#PriceCond').text(s1 + 'x');

    var priceChangeFunc =
          function ()
            alert('in priceChangeFunc');





Form inheritance and key press event



I've created a basic form BasicForm which all other forms in my application will inherit. In this basic form I'd like to handle some generic stuff which are common for all of the forms.  An example => key press event, for when user would press ESC key in any of my forms it would automatically close that form. This is how I tried to do it: 


public ref class BasicForm : public System::Windows::Forms::Form

 	protected: virtual void OnKeyPress(KeyPressEventArgs^ e) override
 		if (e->KeyChar == 0x1b ) // ESC

Want to show value in a text box after click event


I've two text box startdate and enddate. I will input two date into two text box one is txtBoxStartDate and another one txtBoxEndDate. I want to show the duration of these two dates after I just click on duration text box. Can anyone please tell me the whole procedure using javascript or jquery? I know the calculation in C# but as I'm a beginner of javascript,so I need help.

Employee Training Export event and remove rich text editor

I have couple of problems with employee training template.

There is an export event on this template to your calendar. You can click on this button ( export event) and you can save this ics file on to your outlook calendar. Can I anyhow change the text of this "export event" text to something else. I went to sharepoint desinger and it doesnt even have export event listed there.. just dll.. and when I do view source on the page i see under HTML.. but How can i change this?


When someone is trying to add a new course we would like to users to not have capibility of changing fonts/ etc.. When you enter course desciption rich text editor gets enabled... on top. Is tehre a way to disable this for this template or specific sites?

Please help

Thank you

Creating a Text change event as web part



I have a list, in which I have added a column( asp.net textbox) using SharePoint designer.

I want to create a web part, in which on the textchange event of the textbox, i want to do some server transactions and update another asp.net textbox in the list page.

I have created the list. Created a textbox and in the Textbox datafield, associated it with the column created in list through the site.

How to create a textchange event as a web part?

Thank you

AutoCompleteStringCollection for text box in DataGridView 2.0

I have been searching for a way to have autocomplete in a DataGridTextBox
object. There does not appear to be an obvious way to do this like you would
for a TextBox outside of a grid using the AutoCompleteCustomSource. Any
thoughts on how I can add this collection? :)

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Built-in Functions - Text and Image Functions

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.

Conversion of text files from ANSI to UTF-8

reading and writing text files in ANSI format and
writing html-files in Charset ISO-8859-1 (Western Europe).

Text to Voice

Text to Voice and Voice to Text convert

Voice to Text conversion:-

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

reference from menubuttons to text parts in article on the same page


Hi, I'm searching now for hours but couldn't find it.Cry

In my menu i have several buttons which (by a <a href..) should go the a part of an article that is in the same form.

Menu button : What is a database should go to the page default.aspx and in there is an article published.
A part of this article is having a piece of text about "what is a database"

Menu button: how to make a query should go to this same article in the same page but then to the part that is have the piece about the query. The next could be an example of what i'm doing:

    <li><a href="default.aspx ?????>what is a database</a></li>
    <li><a href="default.aspx ?????>what is a query</a></li>

Where my question marks are, there should be a connection to that particular piece of text.
In each article part there is an ID="text1" and the second part id="text2"

How shoudl i do that, Should i use a question mark.
Please give me some guidance how to structure the <li> statement or a pointer where I can read about it.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend