Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 19:45

  • Please register to post and access all features, it's quick, easy and FREE!

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.

Reply
 
Old   #1
 
zhalyn's Avatar
 
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 160Text.Lengthi--)
               {
                   
label1.Text Text.Length.ToString();
               }

        }




        private 
void label1_Click(object senderEventArgs e)
        {
            
CharLimit();
            
        }

        private 
void textBox1_TextChanged(object senderEventArgs e)
        {
            
CharLimit();
        } 
zhalyn is offline  
Old 03/10/2011, 13:06   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
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.
Korvacs is offline  
Thanks
1 User
Old 03/11/2011, 10:54   #3
 
zhalyn's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
Quote:
Originally Posted by Korvacs View Post
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>= 160i--)
            {
                
label3.Text Text.Length.ToString();
                
label3.Refresh();
            }
        }

        private 
void label3_Click(object senderEventArgs e)
        {
            
CharLimit();
        }

        private 
void textBox1_TextChanged(object senderEventArgs e)
        {
            
CharLimit();
        } 
where if i type, character count counts down from 160 to 0 :S
zhalyn is offline  
Old 03/11/2011, 11:40   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
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?
Korvacs is offline  
Old 03/11/2011, 11:52   #5
 
zhalyn's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
Quote:
Originally Posted by Korvacs View Post
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 senderEventArgs 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
zhalyn is offline  
Old 03/11/2011, 12:02   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
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.
Korvacs is offline  
Old 03/11/2011, 12:17   #7
 
zhalyn's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
Quote:
Originally Posted by Korvacs View Post
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!
zhalyn is offline  
Old 03/11/2011, 14:10   #8
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by zhalyn View Post
any tip to make it a countdown?
limit - current?
nTL3fTy is offline  
Old 03/11/2011, 14:23   #9
 
zhalyn's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
Quote:
Originally Posted by nTL3fTy View Post
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
zhalyn is offline  
Old 03/11/2011, 14:36   #10
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by zhalyn View Post
PHP Code:
 this.label3.Text Convert.ToString(this.textBox1.TextLength) + " Characters Long"
PHP Code:
 this.label3.Text = (160 textBox1.TextLength) + " Characters Left"
nTL3fTy is offline  
Old 03/11/2011, 16:01   #11
 
zhalyn's Avatar
 
elite*gold: 0
Join Date: Aug 2009
Posts: 560
Received Thanks: 774
Quote:
Originally Posted by nTL3fTy View Post
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 senderEventArgs e)
        {
            if (
checkBox1.Checked == true)
            {
                
timer2.Start();
            } 
PHP Code:
      private void timer2_Tick(object senderEventArgs 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
zhalyn is offline  
Reply


Similar Threads 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 +2. The time now is 19:45.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.