.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

Dynamically resizing text while wrapping and truncating!

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :WPF

I have a slightly complicated setup that I will demonstrate here:

<Window x:Class="Resizing_Test.MainWindow"
    Title="MainWindow" Height="344" Width="

View Complete Post

More Related Resource Links

Want to Create Table Dynamically With text Control in WinForm Csharp

Hello To All... from Many Days i m tryng to create a simple table using csharp in WinForm.Which will include textbox in each cell according the Passed No of Col & Row. but not getting the proper result. Actually i want to trace each cell data and want to save each cell data to data base : eg. in cell 11(1col & 1row) i m having Combobox which having some item list and when the user select the list item the data will save to the database. Regards, Praveen    What is the Key of Life ... Its Sharing Your Thought & Knowledge ...

Dynamically added text boxes disappears after page refresh


Dim objDatabase As New database
        Dim objAdapter As SqlDataAdapter
        Dim objDataset As New DataSet
        Dim objAdapter1 As SqlDataAdapter
        Dim objDataset1 As New DataSet
        Dim objAdapter2 As SqlDataAdapter
        Dim objDataset2 As New DataSet

        objAdapter = New SqlDataAdapter("SELECT first_name + ' ' + last_name as [Name],father_mobile_no as [Father Mob No],mother_mobile_no as [Mother Mob No] FROM student_data WHERE class='" & cmb_class.SelectedValue & "' and division = '" & cmb_division.SelectedValue & "' and school_id='" & Session("school_id") & "'", objDatabase.con)
        objAdapter.Fill(objDataset, 0)
        If objDataset.Tables(0).Rows.Count > 0 Then

            Dim dt_table As DataTable

Is there any Way to change the header text of an template field dynamically


<asp:TemplateField HeaderText="Award name" >

i want to Assign the header text from code behind

is their any method or way to do this ??????




Resizing panels dynamically



I have an asp.net page with two panels, and I'm adding controls to the panels dynamically. I create at table programatically and add it to one panel - the table content comes from a database and the table (and panel) resize accordingly. My problem is that I want the second panel to be the same size as the main panel. I've tried Panel.Height but as I haven't set a height for the panel this is returning 0. I've tried a javascript workaround but I can't get it to work

<script type="text/javascript">
    window.onload = setLongest;
function getLongest_1() {
colLength = new Array(1);
colLength[1] = document.getElementById("ctl00_ContentPlaceHolder1_MainPanel").offsetHeight;
colLength[2] = document.getElementById("ctl00_ContentPlaceHolder1_RightPanel").offsetHeight;
return colLength[0];

function setLongest() {
divLen = getLongest_1();
//document.getElementById("ctl00_ContentPlaceHolder1_MainPanel").style.height = divLen;
//document.getElementById("ctl00_ContentPlaceHolder1_RightPanel").height = divLen;
As you can see I've commented out the lines that assign the values to the panels and tried 

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 change Progressbar status Text in setup project dynamically


Hello ,

I create a Setup for my project in Visual Studio.I want to change the progress bar status Text at runtime.The default status text is "Please Wait" .To change the Status Text I call the API method "MsiGetMode" .But there are two parameter of this method one is "install (Handle to the installation provided to a DLL custom action or obtained through <see cref="MsiOpenPackage"/>, <see cref="MsiOpenPackageEx"/>, or <see cref="MsiOpenProduct"/>) " How can i get this first parameter in my installer class.And second parameter is "runmode(Specifies the run mode)" .If there is any other way how can i do that.

Please help me

Thanks & Regards,

Vipin Kumar

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


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.

Dynamically Create Controls in ASP.NET by Using Visual C# .NET

This article demonstrates how to dynamically create a control for an .aspx page. The sample project does the following:
Creates two TextBox controls.
Verifies that the contents (TextBox.text) and the attributes of the TextBox are saved across posts to the server.
Illustrates handling events that are posted by a dynamically-created control

Dynamically Create Controls in ASP.NET with Visual Basic .NET

This step-by-step article describes how to dynamically create controls for an ASPX Web page.

The sample project does the following:
It creates two TextBox controls.
It verifies that the TextBox contents (TextBox.text) and attributes are saved across posts to the server.
It describes how events that are posted by a dynamically created control are handled.

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.

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:-

dynamically adding sql server columns based on number of files in fileuploader


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.


I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!


Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

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