473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Auto Size Label Text With Sliding Text

Tyler Wiebe
I'd like to know how to auto size the text inside of a label to be the height of the label, but currently, just by doing

Expand|Select|Wrap|Line Numbers
  1.  
  2.             label1.Location = new Point(3, 3);
  3.             label1.Size = new Size(Size.Width - 3 * 2, (Size.Height - 3 * 2) / 3);
  4.             label1.BackColor = Color.Black;
  5.             label1.BringToFront();
  6.  
  7.             label1.UseCompatibleTextRendering = true;
  8.             label1.TextAlign = ContentAlignment.MiddleLeft;
  9.             label1.ForeColor = Color.FromArgb(255, 70, 160, 122);
  10.             label1.Font = new Font("Palatino Linotype", label1.Height, FontStyle.Regular, GraphicsUnit.Pixel);
  11.             label1.Text = "gpGP";
  12.  
The bottom of the "gp" goes a bit out of the bottom of the label and get cut off, and the "GP" are just fine.

I'd like to know how to auto size the text height to fit the height of the label so that the text doesn't get cut off, I'm not interested if it fits in width wise, since the next part I'm interested in is how do I make it so that if the width of text is longer then the label, that it'll slide across to the left, and then slide back in on the right when it's gone, and then when it reaches the left, it'll wait for a period of time and then start all over.
Mar 20 '11 #1
0 1287

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Piotr | last post by:
I need a VBA macro to copy all text from text objects in the igrafx flowcharter Diagram to clipboard or to save it to a text file (in order to count the text I translated). I tried the...
1
by: siliconpi | last post by:
I'm looking for the simplest and cleanest way of having 10 buttons on a form, on which if I move my mouse over, a label's text changes as specified. I'm using Visual Basic .NET and I'm not too...
4
by: Microsoft | last post by:
I've been trying to find a way to auto size the columns of a data grid but I'm having some problems with it... I have a boolean column that are check boxes for the first column, but most of the...
5
by: iKiLL | last post by:
Hi All, I am trying to Bulid Windows Mobile Forms Control with C# in VS2005 using CF2. On this control A lable is created and some text set for the control. My problem is that i dont know how...
4
by: shihab | last post by:
I have one multi line text box.i want to 'add text this text box one by one' from database(eg.Customer Name Field).i am using C#.plz give me a solution thanx shihab
1
by: Boki | last post by:
Hi All, I use a picturebox to show image form URL string. When auto size propertise disable, it works well, but fail whenever auto size is enable. pictureBox1.Image = new...
0
Ali Rizwan
by: Ali Rizwan | last post by:
Hi I want to make sliding text to my title bar of my application and also want to slide text on my taskbar. Plz Help me
0
by: EgoSum | last post by:
Hi, Is it possible to set the DataGridViewComboBoxColumn drop down to auto-size horizontally to the contents of item with maximum length in Items Collection? I want to get something like this:...
4
by: sandeepsangshetty | last post by:
Hi friends, i created one windows form in c#. In that form through 'text box' text i want to add items to the 'list box' with the help of button. Here the problem is 'while entering the items to...
1
by: gorstiedaghost | last post by:
Hi, atm i have a peice of code that will open microsoft word, and then copy text that it inside two speech marks. But instead of copying the text from the speech marks, i want to change the code to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.