Click here to Skip to main content
15,901,426 members
Home / Discussions / C#
   

C#

 
GeneralRe: Updating my main form (gui) from another class Pin
Andy Davey16-Oct-03 14:12
Andy Davey16-Oct-03 14:12 
GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 14:27
eggie516-Oct-03 14:27 
GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 14:41
eggie516-Oct-03 14:41 
GeneralRe: Updating my main form (gui) from another class Pin
Guillermo Rivero16-Oct-03 15:27
Guillermo Rivero16-Oct-03 15:27 
GeneralRe: Updating my main form (gui) from another class Pin
eggie516-Oct-03 15:44
eggie516-Oct-03 15:44 
GeneralRe: Updating my main form (gui) from another class Pin
Guillermo Rivero16-Oct-03 15:48
Guillermo Rivero16-Oct-03 15:48 
Generalunessecary reply Pin
eggie516-Oct-03 15:52
eggie516-Oct-03 15:52 
GeneralRe: unessecary reply Pin
Guillermo Rivero17-Oct-03 3:40
Guillermo Rivero17-Oct-03 3:40 
Here it goes...

namespace WindowsApplication1<br />
{<br />
	public class Form1 : System.Windows.Forms.Form<br />
	{<br />
		private bool _done = false;<br />
		private ProgressBar _pb = new ProgressBar();<br />
		private Form2 _form = new Form2();<br />
		private System.Windows.Forms.Button button1;<br />
		private System.Windows.Forms.Button button2;<br />
		private int _value=0;<br />
<br />
		public Form1()<br />
		{<br />
			this.Size = new System.Drawing.Size(300,300);<br />
<br />
			this.button1= new Button();<br />
			this.button1.Location = new System.Drawing.Point(8, 240);<br />
			this.button1.Name = "button1";<br />
			this.button1.Click += new System.EventHandler(this.button1_Click);<br />
<br />
			this.button2= new Button();<br />
			this.button2.Location = new System.Drawing.Point(100, 240);<br />
			this.button2.Name = "button2";<br />
			this.button2.Click += new System.EventHandler(this.button2_Click);<br />
<br />
			this.Controls.Add(this.button1);<br />
			this.Controls.Add(this.button2);<br />
<br />
			this._pb.Location = new Point(0,0);<br />
			this._pb.Width = 100;<br />
			this._pb.Minimum=0;<br />
			this._pb.Maximum=100;<br />
		}<br />
<br />
<br />
		private void button1_Click(object sender, System.EventArgs e)<br />
		{			<br />
			_form.Show();<br />
<br />
			if (!_done)<br />
			{<br />
				_form.Controls.Add(_pb);<br />
				_done=true;<br />
			}<br />
		}<br />
		<br />
		private void button2_Click(object sender, System.EventArgs e)<br />
		{	<br />
			if(_value<100)<br />
				_value +=10;<br />
			else<br />
				_value=0;<br />
<br />
			_pb.Value=_value;<br />
		}<br />
<br />
		[STAThread]<br />
		static void Main() <br />
		{<br />
			Application.Run(new Form1());<br />
		}<br />
<br />
	}<br />
}


I think that's what you want, isn't it ?

Eek! | :eek:

Free your mind...
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:46
eggie517-Oct-03 13:46 
GeneralRe: Updating my main form (gui) from another class Pin
ThunorMagi16-Oct-03 18:15
sussThunorMagi16-Oct-03 18:15 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 1:53
eggie517-Oct-03 1:53 
GeneralRe: Updating my main form (gui) from another class Pin
Bo Hunter17-Oct-03 11:32
Bo Hunter17-Oct-03 11:32 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 11:35
eggie517-Oct-03 11:35 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:49
eggie517-Oct-03 13:49 
GeneralRe: Updating my main form (gui) from another class Pin
eggie517-Oct-03 13:52
eggie517-Oct-03 13:52 
GeneralQuestion regarding DictionaryBase Collections class Pin
Subha Sundara16-Oct-03 11:40
Subha Sundara16-Oct-03 11:40 
GeneralRe: Question regarding DictionaryBase Collections class Pin
Jeff Varszegi16-Oct-03 12:01
professionalJeff Varszegi16-Oct-03 12:01 
GeneralGDI+ question Pin
16-Oct-03 6:22
suss16-Oct-03 6:22 
GeneralRe: GDI+ question Pin
Heath Stewart16-Oct-03 8:41
protectorHeath Stewart16-Oct-03 8:41 
GeneralRe: GDI+ question Pin
sacoskun18-Oct-03 20:23
sacoskun18-Oct-03 20:23 
QuestionIs it possible to catch SystemEvent in Windows service? Pin
EnkelIk16-Oct-03 5:09
EnkelIk16-Oct-03 5:09 
AnswerRe: Is it possible to catch SystemEvent in Windows service? Pin
ankita patel16-Oct-03 12:22
ankita patel16-Oct-03 12:22 
GeneralC# -> Remoting and MarshalByValue Pin
Alsvha16-Oct-03 3:36
Alsvha16-Oct-03 3:36 
GeneralRe: C# -&gt; Remoting and MarshalByValue Pin
Guillermo Rivero16-Oct-03 7:59
Guillermo Rivero16-Oct-03 7:59 
GeneralRe: C# -&gt; Remoting and MarshalByValue Pin
Alsvha16-Oct-03 19:12
Alsvha16-Oct-03 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.