473,732 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i create a multi-line textbox dynamically?

I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill
Jan 23 '07 #1
2 3668

BillE wrote:
I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill
I'm pretty sure I've had Multiline labels by adding a new-line
character to the string in the label. In the Designer View, edit the
Text property of the label, click on the down arrow to get the large
text edit box, then press Shift-Enter to go to a new line.
In code, use vbNewLine to add a new line.

Jan 23 '07 #2
Thanks Zoltar!
I created a label dynamically, set the minimum and maximum widths to be the
size I wanted, and set the Autosize to true so it would expand vertically.
It works great.

<lo*********@gm ail.comwrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
>
BillE wrote:
>I need to create a multi-line label dynamically.

Since labels aren't multi-line, I'm creating a textbox and making it look
like a label with the multiline property set to true.

I want to increase the height of the textbox only if there are multiple
lines, and leave it at the default height if the text does not wrap after
setting the Text property.

I thought I could use the Lines property after setting the Text property,
but Lines is always = 1 even if the

I would appreciate any advise.

Thanks
Bill

I'm pretty sure I've had Multiline labels by adding a new-line
character to the string in the label. In the Designer View, edit the
Text property of the label, click on the down arrow to get the large
text edit box, then press Shift-Enter to go to a new line.
In code, use vbNewLine to add a new line.

Jan 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1205
by: dotnetnewbie | last post by:
I'm a dotnet newbie and have been developing some web applications in asp.net. I have a requirement to load files from a remote file cache server (many of them actually) to a web image viewer. The files can be sensitive and because of that I can not use a virtual directory to access them. A coworker has suggested that I create a com + object that would read the file and stream it back to the asp application but I really don't know how...
1
1405
by: Grahammer | last post by:
Is it possible to create a multi element property in VB.Net? Something similar to the "Location" or "Size" property. Each of these has two elements. I'm trying to create an IMAGE property that has four different elements. One for each state of a button. I would set the image for a normal button like this: MyButton.ButtonImage(ButtonStates.Normal) = imgButtons.Images(0)
4
1557
by: Daylor | last post by:
hi. i have multi thread application in vb.net is there a way NET support, so i can mark the class , to be access only for 1 thread each time ? if there is , small sytax sample will help //what i need to add , so only 1 thread per time can access this class in MultiThread app.
0
1088
by: Eddie | last post by:
In Microsoft Access form, combo box can be binded to the table or query and can be shown as multi column, getting a actual binded column and showing columns. I'm struggling to make a multi-column combo box now but in vain. The combo box in VC.NET seems not having multi-colmn property. Is it true? If I can't use combo box as a multi column container, how can I show the information like Select your name :
2
1524
by: ME | last post by:
I need to know how to create a MULTI page report. All I can seem to create is a report with only one page, even though the datasource it is bound to returns multiple records. I have posted an example of my source code here: http://mreprogramming.com/currentrelease/WindowsApplication25.zip What am I doing wrong? Thanks, Matt
2
1866
by: news.sbcglobal.net | last post by:
Here's my problem: I'm developing an ASP.NET 2.0 application that has a user select one or more auto manufacturers from a listbox ("lstMakes"). Once they do this, another listbox ("lstModels") should be filled with all matching models made by the selected manufacturers. If lstMakes was not multi-select, I'd have no problem. But in this case it has to be multi-select. The database is SQL Server 2005 which does not accept arrays as...
5
2142
by: Richard Lewis Haggard | last post by:
I am trying to create multi-dimensioned arrays in conventional ASP pages and pass these arrays as arguments to functions that are in a C# interop assembly. ASP complains because it doesn't recognize that the created array is the same as the declared interface argument. The C# function is expecting to receive a 2 dimensioned array and is declared like this: public object InteropFunc( string s1, object arValues ); What should the ASP...
2
1616
by: cpressley2 | last post by:
Hi, On a multi-partition instance, can you create a database on a single parition? How??? The db architects want to use one instance for four databases where only one is big enough for a multi-partition. The other three are small. I'd like to create them only on one partition but can't find any documention on how to do this.
10
3992
by: SM | last post by:
Hello I'm trying to create a multi dimensional array in JavaScript, but after some reading i still can't figure out how to apply it to my model. Here it is: I have a list A and for each item in the list A i want to associate an undetermined number of items. The complication for me is the fact that the items to associate in list A are undetermined.
1
3463
by: jimjack145 | last post by:
Hi All, I have one form with two multi select list box. I want to create query when user select value from it and click for result page. However i search on net but not find any code example. If any body have any example link or code then please reply this forum as soon as possible. I am not getting how i create mysql query for the same. Hope soon i will get good reply here. :) Regards,
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.