I'm trying to make a template form that prints out a string in the middle, this string will be in a label or a textbox (still figure out which would be better there).
What I need to do is get the string to write to the label, then it's going to print out. After that, I want the label to display more of the string.
I'm thinking of doing it like this.
Write string to label
Print
Start a loop
Remove portion that was written from string
Erase label content and write in it again
Print
Loop until full string is written
I am however a bit confused on how to tell how much can be seen by the user. Is there a visible text option, or some command I don't know of, that would do this? Or anyone have an idea.
Loading
Charles MorissettePosted Apr 1, 2011, 3:37 PM
I replicated this with see more, which I'm starting to think I might have an idea on how to fix. When you click see more, the label should move up so you can see the text following what you can see is now displayed at the top.
Sam HobbsPosted Apr 1, 2011, 3:12 PM
Charles MorissettePosted Apr 1, 2011, 9:56 AM
(granted I will keep in mind the scrolling text trick)
This is a cheap project I made just to show what I am lost on.
The three buttons preset 1, 2 and 3 are just examples texts, I took them wiki since it's easy to get a lot of text on wiki.
The label is small, but server it's purpose.
You can change the font size from the scroller with the button "Change font size" next to it.
If you REALLY want you can put your own text in the text box - this is what I am planning once I get around to make this form in my other project - but the presets server their purpose right now.
What should happen/I am having issues with : I left the see more button blank because I have no real idea where to start. What it should do is check what is written and visible in label 2 (the label with the 3d border) and then show the following characthers that cannot be read - and no, a vertical scroll bar won't work as this has to be printed out in my last project.
I was originally planning on trying to figure out how to get what the was displayed, and then removing it from the label string (EX: Preset 1, Bats until capable of true is visible in default font - so removed the starts until the word true when you click see more).
I'm thinking it might be easier instead to make an invisible scroll bar and advante it a certain pixel count - which is what I will try. Is there a way to make the label not display partial characther? In the presets, you see the top of the characthers from the line below at the bottom, is there a way to make them not appear unless they can be fully seen?
Some help would be greatly appreciated.
Sam HobbsPosted Mar 30, 2011, 7:26 PM
Scrolling Text Marquee Control
FroglegPosted Mar 30, 2011, 1:11 PM
1: You will need a textbox for user input
2: A fontdialog
3: The method used to split the string/s from textbox
With the code I uploaded, you at least have an idea where to start
Give it a go - let us know if you have any problems
Charles MorissettePosted Mar 30, 2011, 1:00 PM
However, the user might switch it from Hi I am here to "oh no you are over there now oh no" and put the font from 11 to 8.
Or he might switch it to "i have a really good tv yes I do have a really good tv" and put the font from 11 to 24.
I would still need to get the currently displayed text from the label, as the label/textbox will not be of variable size, and that's the only real info I have to go off of writting my method.
FroglegPosted Mar 30, 2011, 11:54 AM
Charles MorissettePosted Mar 30, 2011, 11:31 AM
It would print
Label : Hi I
Label : am
Label : here
On three different pages. I just need to check how much that is written is seen. (EX: Write Hi I am here to the label, remove "Hi I" from the string, print, write "am here" to the label, remove "am", print, write "here" to the label, remove here to make the string empty, print.
FroglegPosted Mar 30, 2011, 11:26 AM
Add label, button and timer to a form
{
public partial class Form1 : Form
{
int count = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
switch (count)
{
case 1:
label1.Text = ("This");
break;
case 2:
label1.Text = ("This is a");
break;
case 3:
label1.Text = ("This is a string");
break;
case 4:
label1.Text = ("This is a string that");
break;
case 5:
label1.Text = ("This is a string that grows");
timer1.Stop();
break;
}
count++;
}
}