|
You last visited: Today at 10:40
Advertisement
[c#]Displays current character/character limit
Discussion on [c#]Displays current character/character limit within the CO2 Programming forum part of the Conquer Online 2 category.
03/10/2011, 10:31
|
#1
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
[c#]Displays current character/character limit
I have searched on google and youtube but still i can't understand how
to show the current character on the label :S
PHP Code:
private void CharLimit()
{
if (textBox1.Text.Length >= 160)
for (int i = 160; i < Text.Length; i--)
{
label1.Text = Text.Length.ToString();
}
}
private void label1_Click(object sender, EventArgs e)
{
CharLimit();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
CharLimit();
}
|
|
|
03/10/2011, 13:06
|
#2
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Code:
label1.Text = Text.Length.ToString();
label1.Refresh();
A simple look through the methods associated to the label could have solved this issue.
|
|
|
03/11/2011, 10:54
|
#3
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
Quote:
Originally Posted by Korvacs
Code:
label1.Text = Text.Length.ToString();
label1.Refresh();
A simple look through the methods associated to the label could have solved this issue.
|
Nice, but still the label1's text are not showing the right character counts :S
PHP Code:
public void CharLimit()
{
if (textBox1.Text.Length >= 160)
for (int i = 160; i >= 160; i--)
{
label3.Text = Text.Length.ToString();
label3.Refresh();
}
}
private void label3_Click(object sender, EventArgs e)
{
CharLimit();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
CharLimit();
}
where if i type, character count counts down from 160 to 0 :S
|
|
|
03/11/2011, 11:40
|
#4
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Yeah because you have written it so that your loop starts at 160, and then counts down.
You dont know what you've written?
What do you want to do?
|
|
|
03/11/2011, 11:52
|
#5
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
Quote:
Originally Posted by Korvacs
Yeah because you have written it so that your loop starts at 160, and then counts down.
You dont know what you've written?
What do you want to do?
|
Never mind i found it
PHP Code:
private void textBox1_TextChanged(object sender, EventArgs e) { this.label3.Text = Convert.ToString(this.textBox1.TextLength) + " Characters Long"; if (textBox1.Text.Length >= 160) { button1.Enabled = false; MessageBox.Show("Character Limit Reached to 160"); } else { button1.Enabled = true; }
but it will display characters length :S any tip to make it a countdown?
em going to write a SMS bomber
|
|
|
03/11/2011, 12:02
|
#6
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
You really need to learn to use google, read some basic C# Tutorials, and understand how to perform basic methods and how these can be utilised in order to perform many tasks with a small amount of modifications.
I dont really want to help write an 'SMS Bomber' to be honest, and from the looks of it, I would end up helping alot.
|
|
|
03/11/2011, 12:17
|
#7
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
Quote:
Originally Posted by Korvacs
You really need to learn to use google, read some basic C# Tutorials, and understand how to perform basic methods and how these can be utilised in order to perform many tasks with a small amount of modifications.
I dont really want to help write an 'SMS Bomber' to be honest, and from the looks of it, I would end up helping alot.
|
Well I'm just asking for some minor problems regarding on c# syntaxes
thank you!
|
|
|
03/11/2011, 14:10
|
#8
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
Quote:
Originally Posted by zhalyn
any tip to make it a countdown?
|
limit - current?
|
|
|
03/11/2011, 14:23
|
#9
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
Quote:
Originally Posted by nTL3fTy
limit - current?
|
Ops, What i mean is i want to set count from 160 to 0 but
PHP Code:
this.label3.Text = Convert.ToString(this.textBox1.TextLength) + " Characters Long";
it shows the count from 0 to 160 :S
|
|
|
03/11/2011, 14:36
|
#10
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
Quote:
Originally Posted by zhalyn
PHP Code:
this.label3.Text = Convert.ToString(this.textBox1.TextLength) + " Characters Long";
|
PHP Code:
this.label3.Text = (160 - textBox1.TextLength) + " Characters Left";
|
|
|
03/11/2011, 16:01
|
#11
|
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
|
Quote:
Originally Posted by nTL3fTy
PHP Code:
this.label3.Text = (160 - textBox1.TextLength) + " Characters Left";
|
thanks
Now i have one more problem regarding the form size :S
PHP Code:
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
timer2.Start();
}
PHP Code:
private void timer2_Tick(object sender, EventArgs e)
{
if (Width >= 389)
{
timer2.Stop();
}
else
{
Width += 288;
}
if (checkBox1.Checked == false)
{
timer2.Start();
if (Width >= 677)
{
Width -= 288;
}
}
}
my width wont resize to 389 size :S
im so confuse where i did something wrong
|
|
|
|
Similar Threads
|
WTT iSRO(RedSea)lvl 106 character for rSRO Artemis character!
09/07/2010 - Silkroad Online Trading - 10 Replies
Hey guys/girls,
I want to trade my lvl 106 rogue/bard on RedSea server.
Rev6.com - The 6th Revolution
Character information:
-name : SrO_Diabolik
-build : rogue/bard full STR
-skills : rogue/bard lvl 106 with skills up to date with about 250 k sp left
-items:+2 +3 items with blue,101+5 dagger crit 18,shield 101+5 br 18
-never banned
|
WTT Cabal EU Character for Dekaron EU Character
08/25/2008 - Dekaron Trading - 6 Replies
WTT Cabal Force Archer for Dekaron EU Bagi Warrior
Cabal Character Details :
Force Archer
Lvl : 83
Ranks : Grand Master (50 skills and Completer)/ Appretience(almost Regular)
All Skiils Bought
Quests from 60+ are not done because of skilling at dark bladers so from lvl 64 i made 83 by skilling
Class Rank : 9
|
making your current Character FAt with scroll
08/18/2008 - Perfect World - 3 Replies
Anyone can guide me to this, Modifying the ini file doesnt make changes in the present char
|
All times are GMT +1. The time now is 10:40.
|
|