.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 can I hide the caret of a RichTextBox control?

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :Windows Application
Hello,Can you please tell me how can I hide the caret of a RichTextBox control completely while my app is running?Thanks.

View Complete Post

More Related Resource Links

Full desired height of a RichTextBox control?

I don't mean the control's .Height property... ...I have a WinForm with a RichTextBox control, and another control underneath the RichTextBox control.  The RichTextBox control is anchored on the left, top, and right sides, so the width is automatically resized as the parent form is resized.  (it also has its Multiline and and WordWrap properties set to True) The item underneath the RichTextBox needs to always be right underneath it (little whitespace), and the RichTextBox needs to always display its entire text (nothing hidden). As I get the form's resize event, I'd like to update the RichTextBox's hight so all text is displayed, however I'm not seeing any properities or methods which would be helpful.  There is the PrefferredHeight property, but it is always returning 13. Basically, it comes dowen to this: when WordWrap is set to true, is there a way to see what the desired height is?  Or is there a way to see if any of the text is clipped? If not, I suppose my next step would be to roll my own custom control and draw the text myself, keeping track of the autowrap and line count, but I thought I'd post a message here first and see if anyone has a better idea. Thanks, Jeff      

Wrapping Text (and not words) with the RichTextBox Control


Hi all,


What I am trying to do is create a RichTextBox control on my form. I want the RichTextBox control to only be able to contain 32 characters per line. I am using Courier New font, which is a fixed width font. I can set the width of the control so its long enough to show 32 characters, which works. The problem I am having is that after 32 characters, if I set the WordWrap property to true, it will wrap the last word. I do not want the last word to wrap. I simply want it to go to the next line. I do not want any carriage returns added to the code. I just, visually, want the control to jump to the next line, without wrapping any words. If I set WordWrap to false, then it doesn't wrap at all. it simply keeps going past 32 characters.


Does anyone know a way to make this control wrap text at 32 characters?

How to Show / Hide Scrollbars in new 3.5 SP1 Beta WPF WebBrowser Control

I've happily installed the latest Dot Net Framework 3.5 SP1 Beta. I'm using the new WebBrowser control, however I need to be able to hide and show the scroll bars depending on what content I show.

I've spotted this blog by Don Burnett; http://blog.donburnett.com/NewBlog/wpf/using-the-new-wpf-based-web-browser-control-in-net-3-5-sp1/

And there is a snippet of code which shows dependancy properties for the scroll bars..

<WebBrowser Margin="0,49,0,21" x:Name="webBrowser1" Grid.ColumnSpan="3" Source="http://blog.donburnett.com" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" MaxLines="1"/>

However, when I attempt to use this XAML code in my application, Blend reports that the the HorizontalScrollBarVisibility, VerticalScrollBarVisibility 

count no of Characters in Richtextbox control in infopath


Hi All,

Can anybody tell me how to count the Number of characters ,while entering in the RichTextBox control and have to display the no of characters in the above 






Regards, Mansoor

How to hide nodes in Menu control?


I have the following Menu control:

<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" 
                    EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal" 
<asp:SiteMapDataSource ID="smdsMyMenu" runat="server" ShowStartingNode="false" SiteMapProvider="pebMySiteMapProvider"/>

How do I hide the root node and some other nodes if I do not want it to show on the navigation menu?

How to hide a method while creating custom control by inheriting WebControl?



I am creating a custom control by inheriting a server control, say LinkButton. There are properties like "BorderColor" available in LinkButton. Let's say, I don't want this particular property to be available when I create an instance of the custom control.

I want to completely hide this particular property (I don't want to override it but disable it.)

My code is as follows:

    Class MyLinkButton
        Inherits LinkButton

        'I want to hide the following method in such a way that if an object of MyLinkButton is created, the following property is not available
        Public Overrides Property BorderColor As System.Drawing.Color
                Return MyBase.BorderColor
            End Get
            Set(ByVal value As System.Drawing.Color)
                MyBase.BorderColor = value
            End Set
        End Property

    End Class

Can anyone help me with this oir provide few pointers?

Silverlight RichTextBox Control For Beginners

Need to use the RichTextBox control of the Silverlight 4 and need ways to bind the RichTextBox control to the view model properties.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Hide a repeater in ASP.NET C# if the DataSource contains no items?

I have an ASP.NET page that uses a repeater nested within another repeater to generate a listing of data. It's to the effect of the following:
In the (C#) code-behind I'm basically using LINQ to pull a listing of information from an XML document and bind that information to the first repeater.

Searching for the answer to this, it seems the method is to determine whether the data for the nested repeater is empty. If it is, then you set the visibility of the repeater to false.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

GridView control to show master-child or master-slave data, written in c#, asp.net

I previously made a master slave datagrid using Visual Studio 2003 .Net (original article) that would allow users to show data to clients using collapse and expand features. These features however did not carry over to gridview for many users. This tutorial will explaing how to create a collapsable/expandable gridview in frameworks 2.0 and higher
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