.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

Full desired height of a RichTextBox control?

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Windows Application
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      

View Complete Post

More Related Resource Links

Getting full font height

How I can get full font height (height of system caret in TextBox or RichTextBox control when Font property is set to particular font) in pixels? I have tried Graphics.MeasureCharacterRanges and Graphics.MeasureString functions, but result is not equal caret height. It's terrible! A have also tried Win32 API function GetTextMetrics. Can someone help me?

WPF control size is larger than explicitly set width and height values.

I created a Canvas with fixed Width and Height (256x256). Next to it I put an Image control displaying a 256x256 texture without stretching. How is it possible that actual sizes of both controls on the screen differ so much? Here - is the screenshot illustrating size mismatch. And here - the TestLines256.png in case someone liked to check it (and maybe point out that I'm stupid and this texture is 180x180 and not 256x256 as I claimed). XAML with creation of the controls:   <Window x:Class="OversizedQuad.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" SizeToContent="WidthAndHeight"> <StackPanel Orientation="Horizontal"> <Canvas Width="256" Height="256" Background="Red" /> <Image Stretch="None" Source="TestLines256.png" /> </StackPanel>

How to capture the full file path from Async File Uploader Control?

Hi,I have an Async File Uploader control inside a Repeater which is inside an update panel.Now,I am uploading the file into ftp,so I am not uploading the video file,using SaveAs() method.For uploading the file in ftp,I have this UploadFile method which takes these four parameter:FileName, UploadPath, FTPUser, FTPPassword.Now this FileName,I have to send the full file path. My UploadComplete event looks like this:<pre lang="cs">protected void AsyncVideoUpload_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)      {//VideoPath is a session variable            VideoPath = string.Empty;            if (AsyncVideoUpload.HasFile)            {               // string filepath = AsyncVideoUpload.PostedFile.FileName;                  string filepath = e.filename;//above two captures only the file name,but I want the total path,like c:/MyDocuments/...                                 UploadFile(filepath, "","test","Value*12"); &

Full Control users only able to edit Shared Version of page in MOSS 2007

Hi, In MOSS 2007 we have a site collection that does not allow the owners to edit pages. There is no broken inheritance in the permissions, and when a user clicks "Site Actions" and then "Edit" they get a toolbar saying they are only editing the Shared Version of the page. No pages are checked out to any other users either and the users attempting this (including the Farm account) are not able to edit these pages. What would be the next steps to debugging this problem as it is not one I have encountered previously?  

How can I hide the caret of a RichTextBox control?

Hello,Can you please tell me how can I hide the caret of a RichTextBox control completely while my app is running?Thanks.

How to Control each cells width and height of a Table ?

Hi, I want to fix the size of each cells of a table . for that i used Style like this: <td style="width:10px;height:10px"> contents </td> But it seems that there is no any effect of applying these settings.How can  i set its width and height. It seems that it purely depends on the contents of cells. Now, if suppose there are two rows, <tr id='r1'> <td id='d1'> content of size 10px </td> <td id='d2'> content of size 10px </td> </tr> <tr id='r2'> <td id='d3'> Content of size 400px </td> <td id='d4'> content of size 20px </td> </tr>   Then cell of id 'd1' will get a size of 400px ,since its just below cell is of size 400px. I want to fix its size. Is that possible ?  

Not able to add users even efter giving full control

hi all... in my sharepoint site i have 4 groups of people A,B,C and D i ve given the A and B group to have full control. C and D have read control. i have added few users to group A and few to group B. When i log in as either of a user in A am not able to add users to group C , but am able to add users to group D. What migt cause this problem ?? thanks for timely help

How to increase the height of Expander control HEADER in XAML



How to increase the height of Expander control HEADER in XAML?



Many Thanks Deepak

get full path from fileupload control in client side???


<script type="text/javascript" >

        function SetA()

                    document.form1.action = 'Default.aspx?fileName='+document.getElementById('FileUpload1').value;
    <form id="form1" runat="server">
        <asp:FileUpload ID="FileUpload1" runat="server"  />
        <asp:Button ID="btnupload" runat="server" Text="Upload" OnClientClick="SetA()" />



here in the  javascript function i need send full path of upload control?


please help in this situation? if anybody knows other way of sending full path please tell?


thank you,

SharePoint 2007 - lost full control of site collection


We have SharePoint 2007 up and running for a few months.  We have 6 site collections.  Last weekend two of the site collections become read only.  Only two of us are Site Owner with Full Control.

althought, another person and myself are Primany/Seconday Site Collection Administrator.  I verify this by

Central Administration > Application Management > Site Collection Owners.

neither of us can access to the site collection from the web to add pages, to create lists, to add/remove users, or to set permission to the site colletions.

Any idea why, please let us know.  Greatly appreciated.






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?

Header user control appearing on all dialog windows (not desired)

I added a user control in the master page for a particular site definition.  

All good however the problem occurs when I open the dialog to add new documents for example.   The user control appears at the top of this dialog box as well.

This same top header is visible on all open dialog boxes at the top which obviously what i was going for.

How can I have the user header control only appear on main pages? (and not dialog windows?)

hmmm ideas?


Best Way to Develop sharepoint website to get full control


Hi friends,

              I am asp.net developer new to sharepoint2010 what is the best way to develop a share point website for university which has

1)Document Management


and so on

I need to get full control of the website  programatically.

How do the normal sharepoint developers in organizations go for.

I want to learn only through internet..!

Can Any one please guide me 

any help is greatly appreciated..!


My Question is ..!Is there any way to create a sharepoint website other than central administration interface?


Through this administration loading time  is slow..!

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

WSS 3.0 FBA Security Issue with "Full Control" in "Policy for Web Application "


I just set up form based authentication using Active Directory.  I set the following parameters in the web.config:

    <add name="ADConnectionString" connectionString="LDAP://mydomain.com/DC=mydomain,DC=com" />

    <membership defaultProvider="ADMembershipProvider">
        <add name="ADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider,System.Web,Version=,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnectionString" enableSearchMethods="true" attributeMapUsername="sAMAccountName"/>

I then open the central admin, select “Policy for Web Application”...and I add the users that I want to give access from the outside.  So I grant “Full Control” and my problem arose:

When I give the user “full control” access....they can now see everything across the entire sharepoint site?

Where are all the windows permissions I set across SharePoint?

In other words, mydomain\user1 ha

How to set default Height/Width property value of Composite control?

This is my code:

class Regi : CompositeControl
private TextBox nameTextBox;    

[DefaultValue(typeof(Unit), "400px")]
public override Unit Width
return base.Width;

Users with contribute or full control permissions cannot create pages


I've got a problem where users with Contribute permissions or higher - even Full Control (!) - on a site collection cannot create pages.

Site Collection Administrators can create pages fine.

The only way I can get users to create pages is to give them all Contribute permissions to the Master Page Gallery.

The Master Page Gallery, by default, does not inherit permissions from its parent site, it's default out of the box set-up is this:

Approvers  - SharePoint Group  - Read 
Designers - SharePoint Group  - Design 
Hierarchy Managers - SharePoint Group - Read 
Restricted Readers - SharePoint Group - Restricted Read 
Style Resource Readers - SharePoint Group - Read 

Usually having contribute permissions or even full permissions to a site allows you to create a page without having to change the Master Page Gallery's permissions from the above default - we even have site collections which have these settings and work fine.

I don't want to give people unnecessary access to the Master Page Gallery - is there anything else which could be causing this issue?

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