Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 05:04

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

Advertisement



C# WinForms edit controls from another class.

Discussion on C# WinForms edit controls from another class. within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
C# WinForms edit controls from another class.

Please help me i can't use txtBox from the other classes.
badguy4you is offline  
Old 10/09/2012, 00:05   #2
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811
PHP Code:
//call
txtbox.text myclass.bla();

//some other class
public class myclass
{
public static 
string bla()
{
return 
"bla";
}

sry i'm currently on my mobile phone..
Kraizy​ is offline  
Old 10/09/2012, 00:14   #3
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
Quote:
Originally Posted by Kraizy​ View Post
PHP Code:
//call
txtbox.text bla();

//some other class
public class myclass
{
public static 
string bla()
{
return 
"bla";
}

sry i'm currently on my mobile phone..
I will need more clear answer when you get to your PC please because i can't understand what you posted. And thanks a lot for your help
badguy4you is offline  
Old 10/11/2012, 09:14   #4
 
elite*gold: 0
Join Date: Nov 2005
Posts: 40
Received Thanks: 8
For a better understanding and a better help please post some code.
fatalaty is offline  
Old 10/16/2012, 09:59   #5
 
Naworia's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 455
Received Thanks: 418
Quote:
Originally Posted by badguy4you View Post
I will need more clear answer when you get to your PC please because i can't understand what you posted. And thanks a lot for your help
Put some code or screenshot. Do you mean class file or classes?
Naworia is offline  
Old 10/18/2012, 17:21   #6
 
5anku's Avatar
 
elite*gold: 170
Join Date: Jan 2011
Posts: 74
Received Thanks: 74
What you need is a property on the Label

Code:
namespace LabelTest
{
    public partial class TestForm : Form
    {
        // get and set method for Label.Text
        public string _Label
        {
            get
            {
                // Return Label.Text
                return Label.Text;
            }
            set
            {
                // Set Label.Text with value
                Label.Text = value;
            }
        }
        
        public TestForm()
        {
            InitializeComponent();
        }
    }
Code:
    class OtherClass
    {
        public void ChangeLabel()
        {
            // String with Text for Label
            string setThisText = "Bla";
            // Empty string
            string getThisText;
            
            // Attribute of Form
            TestForm Test = new TestForm();
            // Set method
            Test._Label = setThisText;
            // Get method (getThisText is now "Bla"
            getThisText = Test._Label;
        }
    }
}
5anku is offline  
Reply


Similar Threads Similar Threads
[Release]How to edit your class rank in order to get combo/aura
03/01/2014 - Cabal Guides & Templates - 67 Replies
I made this guide because i got a lot of pm how to edit class rank and quest the combo/aura. you should have a 3 characters with different class rank . example: 1st char= class 20 2nd char= class 9 3rd char= class 14
controls
05/24/2012 - DarkOrbit - 2 Replies
I could make a discussion about when I say we are the controls?
Controls
07/31/2011 - AutoIt - 5 Replies
Else
Set your controls like a pro
02/01/2009 - CO2 Guides & Templates - 10 Replies
Heres a quick way to set controls or "hotkeys" in an efficient and durable way. Im gona explain how i set my controls but feel free to make changes for your confort. I set my hotkeys with the CTRL key because you always have to press it anyways. Ctrl+W inventory -you always want to look in your bag Ctrl+D clear -so much talkshit in co Ctrl+S sit -power over 9000 Ctrl+A shift screen -this may seem stupid to some but...



All times are GMT +1. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.