Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hello
I want to create a program that have a TextBox and a Button...and
when user type a word in the TextBox and click the Button in the form showing fishes for text length that fishes colors changes...
any one knows How?
Posted
Comments
OriginalGriff 4-Nov-13 4:16am    
I don't think anyone knows what the heck you are talking about, much less how to do it.

What do "fishes" have to do with text? Why would the color change?

This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
ronakT 4-Nov-13 4:44am    
my teacher wanted it!!! I don't know what to do... I am a beginner. she said to me you have to create a program that show picture of a fish for length of a text...and the fish color has to changes..

1 solution

Do you really mean "fishes" like in "Whales are not fish. They are mammals"?

1) Place an extra Label[^] on your Form[^] that you use for the fishy output.
2) Set the label's Text property[^] to as many "<°)))><" as you want it according to character count.
3) Set the label's ForeColor property[^] to a Color[^] that fits.
 
Share this answer
 
v2
Comments
ronakT 4-Nov-13 4:38am    
I mean fish I want to show pictur of fish... that its color changes
ronakT 4-Nov-13 4:47am    
thank you a lot... I will try it....
ronakT 6-Nov-13 4:27am    
I created it in this way:

<pre lang="c#">private void button1_Click(object sender, EventArgs e)
{
int x = 10;
int y = 95;
int l = textBox1.Text.Length;
for (int i = 0; i < l; i++)
{
Label lbl = new Label();
this.Controls.Add(lbl);
if (i % 2 == 0)
{
lbl.ForeColor = Color.DarkRed;
}
else
{
lbl.ForeColor = Color.YellowGreen;
}
lbl.Text = "<°)))><";
lbl.Show();
lbl.Location = new Point(x + 70, y);
x = x + 70;
if(x==360 & l<=10)
{
x = 10;
y=y+40;
}
else if(x==360 & l>10)
{
x = 10;
y = y + 60;
}
}
}
</pre>
but my teacher did't accept it!!!!!
lukeer 7-Nov-13 9:56am    
Formal: Code doesn't belong in a comment. Use the "Improve question" link and add it in tags like these: <pre lang="c#">YourCodeHere();</pre>
That makes it much easier to read.

On the topic: Did your teacher tell why not?
ronakT 9-Nov-13 3:54am    
he said I have to use drawing tools.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900