Is it possible to use word wrap in a label?
Also
Is there any workaround for adding scrollbar to a label?
You are probably wanting to use a listbox. You will have to do word wrap and justification yourself. There are functions that return the pixel length of a string using a specified font.
Ah, okay, I've got a label that's kinda heavily tied in to different variables etc, but I'm assuming that's a no go with that so i suppose i need to focus on switching over to ListBox. Thanks for the reply bud :D
It's not only possible, labels word wrap by default. But no, you can't easily scroll a label.
Ah, ok cause i have a label that is used as an input box but the text stops at the end,
I had to extend it eastward to fit more letters but it may be because of some predefined word formatting code previously implemented.
Input boxes don't wrap, labels wrap. InputBox != Label.
Yea, this is a very shiesty use of a label:
#define LINE_WIDTH 99 // Max number of characters on a line
#define LINE_COUNT 5 // Max number of lines in the textbox
void PushLine(String line)
{
if (line.Length > LINE_WIDTH)
{
PushLine(line.Truncate(LINE_WIDTH));
PushLine(line.Substring(LINE_WIDTH, line.Length - LINE_WIDTH));
return;
}
String text;
text = String.Format("%s[%s", lblOutput.Text, line); ////////This is the label
int i = text.Length;
int count = 0;
int pos = -1;
while (i)
{
if (text.Chars[i] == '[')
count++;
if (count == LINE_COUNT)
{
pos = i;
i = 0;
}
else
i--;
}
lblOutput.Text = text.Substring(pos + 1, text.Length - pos - 1);
}
Well, I'm guessing there is no possibility of enhancing this label beyond what it already is.
So I'm going to say [SOLVED]
Answer: use ListBox