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

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

How to change the caret shape in Textbox?

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :WPF
I want to show a cartoon caret in my Textbox. I created the caret by calling CreateCaret API, but I can not use it in my Textbox because I cann't get the Textbox handle in WPF.
I need this cartoon effect very much, how can I achieve in WPF?

View Complete Post

More Related Resource Links

Cannot change value of pre-populated textbox in web part

I have a user control inside a web part. I am pre-populating a textbox in the Page_Load event in the code behind of the user control. The value I am pre-populating is a value the user previously entered. The value is pulled from a sharepoint list. We want the user to be able to change this value if they need to. No matter how many times I change the value in this field, it keeps the pre-populated value. It will not save the new value back to the list. The list item is being saved, but only with the pre-populated value. If I remove the line of code that pre-populates the textbox from the page_load event, then I can change the field without issue. Since I have little experience with using user controls, I am not sure what I am doing wrong. Should I be pre-populating this field in another event?  

show value in label on textbox change event

I want to show value in label on textbox change event , means when user enter text in text box then this value should display in label  . I am using this:<asp:UpdatePanel ID="UpdatePanel1" runat="server">    <ContentTemplate>     <asp:TextBox ID="TextBox5" runat="server" ontextchanged="TextBox5_TextChanged" AutoPostBack="true"></asp:TextBox>    </ContentTemplate>    </asp:UpdatePanel>========================================================protected void TextBox5_TextChanged(object sender, EventArgs e)     {         ViewState["xyz"] = Convert.ToInt32(TextBox4.Text) - Convert.ToInt32(TextBox5.Text);         ViewState["xyz1"] = Convert.ToInt32(ViewState["xyz"].ToString()) * 100;         lbldiff.Text = ViewState["xyz"].ToString();         lblprofit.Text = ViewState["xyz1"].ToString();     }protected void TextBox5_TextChanged(object sender, EventArgs e)    {        ViewState["xyz"] = Convert.ToInt32(TextBox4.Text) - Convert.ToInt32(TextBox5.Text);        ViewState["xyz1

Gridview Textbox Value Change

Hi,In my gridview i have productName(Dropdownlist),Description, Quantity, Price,Total and out side gridview i have textboxes like total, tax, discount and GrandTotal. When i select the product it will bind the price and description.  I will enter Quantity value in the quantity column then it will calculate with the price and display the total in the total column.  Where the total column is readonly when the total displayed it will reflect to Total adn grand total textboxes wich is outside of the gridview.  I am able to calculate the total but i am not able to bind the changed value to those text boxes.  when more than one products then it will calculate sum of total column and bind to the total, grand total textboxes.  How can get the total please advise me.Thanks & Regards,Jeevan.

modelpopup will show only when textbox change

Hi..I have one asp.net Textbox and one Modelpopupextender...What my problem is on clicking on textbox it shows modelpopup but I need to show modelpopup only on textbox change or blur how to do?Help me in this

Unable to change textbox values after manual assignment



In my webapp, I have a DropDownList_OnSelectedIndexChanged that assigns values for a number of <asp:textbox'es depending on which entry is selected...

       public void ModifyProjectIDBox_SelectedIndexChanged(object sender, EventArgs e)


            int tempJobID = Get_Selected_Report();

            dbCommandString = "SELECT Name, Address, State, Awarded, StartDate, EndDate, HomeLocal FROM dbo.ProjectInfo WHERE ProjID = " + tempJobID;

            dbComm.CommandText = dbCommandString;


            dbReader = dbComm.ExecuteReader();


                ModifyProjectNameBox.Text = dbReader[0].ToString();


            ModifyProjectAddrBox.Text = dbReader[1].ToString();

            ModifyProjectStateBox.Text = dbReader[2].ToString();


Newbie question re: asp.net textbox + jquery change event


Hello guys,

I thought I was coding a change event correctly, yet somehow i'm not getting any result

I made the simplest of examples to accomplish what i want

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <form id="form1" runat="server">
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

change the color of lines


Please advice---------

Let me explain this.
// aspx
<asp:TextBox runat="server" ID="txtOld" TextMode="MultiLine" Columns="70" Rows="30" Width="425px" />
<asp:TextBox runat="server" ID="txtNew" TextMode="MultiLine" Columns="70" Rows="30" Width="425px" />
<asp:Button Text="Compare" runat="server" ID="btnCompare" OnClick="btnCompare_Click" />

// c#
I have two string

string strOld = "This a line 1\nThis is going to be line 2\rThis is going to be line 3\rThis is line 4";
string strNew = "This a line 1\nThis text is changed here going to be line 2\rThis is going to be line 3\rThis is changed line 4";

Please note that these strings have \n and \r in it.

When form loads, I do something like this
 if (!IsPostBack)
            txtOld.Text = strOld;
            txtNew.Text = strNew;
Web browser automatically splits the strings and align nicely in the Text box like this


how do I change BORDER COLOR for a TEXTBOX (and any other winform control) in a windforms app in VB

Does anyone have the VB code to change  border colors for winform controls such as a textbox?

How to change text of TextBox, when i click into that TextBox



 i am developing a web portal.

my home page contain a search textbox with text "Enter key word", and i want this text will be flush if any one click on that text box.


Add textbox and change ActionLink to use textbox input


How do I add a textbox for user input in the view and then change the link below to user the user input instead of the hard coded ID?

<%= Html.ActionLink("click me", "Index", new { id = 10057 } ) %>

Change the width of the TextBox at runtime depending on it's MaxLength


I know the MaxLength of the TextBox and depending on that I want to change width of the textbox at runtime.

Cannot change text in a watermarked textbox



I have the following code on my page

            <asp:Label ID="lblToiletCreatedDate" runat="server" Text="Created Date"></asp:Label>
            <asp:TextBox ID="txtToiletCreatedDate" runat="server" CssClass="textEntry"></asp:TextBox>
            <asp:TextBoxWatermarkExtender ID="txtToiletCreatedDate_TextBoxWatermarkExtender" 
                runat="server" Enabled="True" TargetControlID="txtToiletCreatedDate" 
            <asp:MaskedEditExtender ID="txtToiletCreatedDate_MaskedEditExtender" 
                runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                Mask="99.99.9999" MaskType="Date" TargetControlID="txtToiletCreatedDate">

In my codebehind, I'm trying to set

Dynamically change textbox value ?


We have a report that in 2008 version of SSRS, we could not dynamically update one parameter (which is a text box) from another  parameter (which is a drop down). Each time the drop down changes, the text box would update.  it only happens when we first preview the report (in other words, the text box is updated by the drop down). If I change the textbox to a drop down, it works. But if I change it back to a text box (i.e. I no longer set Available Values to none), the text box only updates when first previewed.

How to dynamically change the text weight of a textbox



I'm using SSRS 2005 and I would like to change the text weight of a textbox (in a table) dynamically based on a condition from normal weight to bold. Is that possible?

Thanks in advance for your help! Smile


Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Highlighting Rows with TextBox OnFocus

In another article I explained that how you can make the rows of the GridView control clickable and highlight them when they are clicked. In this article I will explain that how you can highlight the GridView rows when you focus on the TextBox which is contained inside the GridView control.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key
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