![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Anything like this? import System.Drawing.*; import System.Collections.*; import System.ComponentModel.*; import System.Windows.Forms.*; import System.Data.*; public class label_change { public label_change() { } public void changeText( System.Windows.Forms.Label lab ) { lab.set_Text("Hello from me"); } } public class Form1 extends System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); label_change a = new label_change(); a.changeText( this.label1 ); } protected void Dispose(boolean disposing) { if (disposing) { if (components != null) { components.Dispose(); } } super.Dispose(disposing); } #region Windows Form Designer generated code /** * Required method for Designer support - do not modify * the contents of this method with the code editor. */ private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // label1 // this.label1.set_Location(new System.Drawing.Point(56, 40)); this.label1.set_Name("label1"); this.label1.set_TabIndex(0); this.label1.set_Text("label1"); // // Form1 // this.set_AutoScaleBaseSize(new System.Drawing.Size(5, 13)); this.set_ClientSize(new System.Drawing.Size(292, 266)); this.get_Controls().AddRange(new System.Windows.Forms.Control[] { this.label1} ); this.set_Name("Form1"); this.set_Text("Form1"); this.ResumeLayout(false); } #endregion /** @attribute System.STAThread() */ public static void main(String[] args) { Application.Run(new Form1()); } } Regards, Lars-Inge Tønnessen |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |