AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 19th March, 2007, 08:23 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Athens in love with Anna :)
Posts: 788

Angry GKR why the labels are not visible (C# code)

This is a part of CPU Stretcher's source code:

Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.IO;
namespace CPU_Stretcher
{
	public class frmCPU_Stretcher : System.Windows.Forms.Form
	{
        	private System.ComponentModel.IContainer components=null;
		private System.Windows.Forms.Button btn_fire;
	        private System.Windows.Forms.Button btn_stop;
        	private System.Windows.Forms.PictureBox pictureBox_fire;
		private Label label_time;
	        private Label label_percentage;
		public frmCPU_Stretcher()
		{
			InitializeComponent();
		}
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.Run(new frmCPU_Stretcher());
		}
		private void InitializeComponent()
        	{
	            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmCPU_Stretcher));
        	    this.btn_fire = new System.Windows.Forms.Button();
	            this.btn_stop = new System.Windows.Forms.Button();
        	    this.pictureBox_fire = new System.Windows.Forms.PictureBox();
	            this.label_time = new System.Windows.Forms.Label();
	            this.label_percentage = new System.Windows.Forms.Label();
        	    this.SuspendLayout();
		    // 
        	    // btn_fire
  	            // 
        	    this.btn_fire.FlatStyle = System.Windows.Forms.FlatStyle.System;
	            this.btn_fire.Font = new System.Drawing.Font("Times New Roman", 9F);
	            this.btn_fire.Location = new System.Drawing.Point(120, 248);
        	    this.btn_fire.Name = "btn_fire";
	            this.btn_fire.Size = new System.Drawing.Size(60, 24);
        	    this.btn_fire.TabIndex = 78;
	            this.btn_fire.Text = "Fire";
	            this.btn_fire.Click += new System.EventHandler(this.btn_fire_Click);
        	    // 
	            // btn_stop
        	    // 
	            this.btn_stop.Enabled = false;
        	    this.btn_stop.FlatStyle = System.Windows.Forms.FlatStyle.System;
	            this.btn_stop.Font = new System.Drawing.Font("Times New Roman", 9F);
        	    this.btn_stop.Location = new System.Drawing.Point(240, 218);
	            this.btn_stop.Name = "btn_stop";
        	    this.btn_stop.Size = new System.Drawing.Size(60, 24);
	            this.btn_stop.TabIndex = 79;
        	    this.btn_stop.Text = "Stop";
	            // 
        	    // pictureBox_fire
	            // 
        	    this.pictureBox_fire.BackColor = System.Drawing.Color.White;
	            this.pictureBox_fire.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox_fire.Image")));
        	    this.pictureBox_fire.Location = new System.Drawing.Point(186, 108);
	            this.pictureBox_fire.Name = "pictureBox_fire";
        	    this.pictureBox_fire.Size = new System.Drawing.Size(105, 96);
	            this.pictureBox_fire.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
        	    this.pictureBox_fire.TabIndex = 74;
	            this.pictureBox_fire.TabStop = false;
        	    this.pictureBox_fire.Visible = false;
	            // 
        	    // label_percentage
	            // 
        	    this.label_percentage.AutoSize = true;
	            this.label_percentage.BackColor = System.Drawing.Color.Black;
        	    this.label_percentage.Font = new System.Drawing.Font("Book Antiqua", 12.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | 			System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(161)));
	            this.label_percentage.ForeColor = System.Drawing.Color.OrangeRed;
        	    this.label_percentage.Location = new System.Drawing.Point(212, 80);
	            this.label_percentage.Name = "label_percentage";
	            this.label_percentage.Size = new System.Drawing.Size(70, 24);
        	    this.label_percentage.TabIndex = 94;
	            this.label_percentage.Text = "000.00%";
        	    this.label_percentage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
	            this.label_percentage.Visible = false;
	            // 
        	    // label_time
	            // 
        	    this.label_time.AutoSize = true;
	            this.label_time.BackColor = System.Drawing.Color.Black;
        	    this.label_time.Font = new System.Drawing.Font("Book Antiqua", 12.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | 				System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(161)));
	            this.label_time.ForeColor = System.Drawing.Color.Lime;
        	    this.label_time.Location = new System.Drawing.Point(134, 80);
	            this.label_time.Name = "label_time";
        	    this.label_time.Size = new System.Drawing.Size(67, 24);
	            this.label_time.TabIndex = 95;
        	    this.label_time.Text = "00:00:00";
	            this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
        	    this.label_time.Visible = false;
	            // 
        	    // frmCPU_Stretcher
	            // 
        	    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
	            this.BackColor = System.Drawing.Color.White;
        	    this.ClientSize = new System.Drawing.Size(449, 300);
	            this.Controls.Add(this.label_percentage);
        	    this.Controls.Add(this.label_time);
	            this.Controls.Add(this.btn_stop);
        	    this.Controls.Add(this.btn_fire);
	            this.Controls.Add(this.pictureBox_fire);
        	    this.Cursor = System.Windows.Forms.Cursors.Arrow;
	            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        	    this.Location = new System.Drawing.Point(270, 20);
	            this.MaximizeBox = false;
        	    this.MinimizeBox = false;
	            this.Name = "frmCPU_Stretcher";
        	    this.ShowInTaskbar = false;
	            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
        	    this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
	            this.Text = "CPU stretcher";
        	    this.TopMost = true;
	            this.ResumeLayout(false);	
                }
		private void btn_fire_Click(object sender, System.EventArgs e)
		{
			Thread t1 = new Thread(new ThreadStart(burn_in));
			pictureBox_fire.Visible=true;
        		btn_stop.Enabled=true;
			btn_fire.Enabled=false;
			label_time.Visible = true;  // This *****ING label is appeared during execution but if we move
	        	t1.Start();                 // the command in burn_in() routine is not appeared GKR, GKR, GKR
		}   
		private void burn_in()
		{
        	    label_percentage.Visible = true;       // WTF this command does not work?????
	            System.Threading.Thread.Sleep(3000);   // Assume this command is the burn-in code
	            btn_stop.Enabled = false;
        	    label_percentage.Visible = false;
	            label_time.Visible = false;            // This command works GKR......
        	    pictureBox_fire.Visible = false;
	            btn_fire.Enabled = true;
		}
	}
}
The program was written in Visual C# 2003.
Yesterday I compiled the source code with Visual Studio 2005.
All OK, no warnings.
Then running the program I encountered problems (that's why I added comments).
Why??????
I am very confused........
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 19th March, 2007, 04:06 PM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

There is no reason I know of that you should have this problem with VS 2K5.

Quote:
Originally Posted by MrSeanKon
This is a part of CPU Stretcher's source code:

Code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;
using System.IO;
namespace CPU_Stretcher
{
	public class frmCPU_Stretcher : System.Windows.Forms.Form
	{
        	private System.ComponentModel.IContainer components=null;
		private System.Windows.Forms.Button btn_fire;
	        private System.Windows.Forms.Button btn_stop;
        	private System.Windows.Forms.PictureBox pictureBox_fire;
		private Label label_time;
	        private Label label_percentage;
		public frmCPU_Stretcher()
		{
			InitializeComponent();
		}
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.Run(new frmCPU_Stretcher());
		}
		private void InitializeComponent()
        	{
	            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmCPU_Stretcher));
        	    this.btn_fire = new System.Windows.Forms.Button();
	            this.btn_stop = new System.Windows.Forms.Button();
        	    this.pictureBox_fire = new System.Windows.Forms.PictureBox();
	            this.label_time = new System.Windows.Forms.Label();
	            this.label_percentage = new System.Windows.Forms.Label();
        	    this.SuspendLayout();
		    // 
        	    // btn_fire
  	            // 
        	    this.btn_fire.FlatStyle = System.Windows.Forms.FlatStyle.System;
	            this.btn_fire.Font = new System.Drawing.Font("Times New Roman", 9F);
	            this.btn_fire.Location = new System.Drawing.Point(120, 248);
        	    this.btn_fire.Name = "btn_fire";
	            this.btn_fire.Size = new System.Drawing.Size(60, 24);
        	    this.btn_fire.TabIndex = 78;
	            this.btn_fire.Text = "Fire";
	            this.btn_fire.Click += new System.EventHandler(this.btn_fire_Click);
        	    // 
	            // btn_stop
        	    // 
	            this.btn_stop.Enabled = false;
        	    this.btn_stop.FlatStyle = System.Windows.Forms.FlatStyle.System;
	            this.btn_stop.Font = new System.Drawing.Font("Times New Roman", 9F);
        	    this.btn_stop.Location = new System.Drawing.Point(240, 218);
	            this.btn_stop.Name = "btn_stop";
        	    this.btn_stop.Size = new System.Drawing.Size(60, 24);
	            this.btn_stop.TabIndex = 79;
        	    this.btn_stop.Text = "Stop";
	            // 
        	    // pictureBox_fire
	            // 
        	    this.pictureBox_fire.BackColor = System.Drawing.Color.White;
	            this.pictureBox_fire.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox_fire.Image")));
        	    this.pictureBox_fire.Location = new System.Drawing.Point(186, 108);
	            this.pictureBox_fire.Name = "pictureBox_fire";
        	    this.pictureBox_fire.Size = new System.Drawing.Size(105, 96);
	            this.pictureBox_fire.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
        	    this.pictureBox_fire.TabIndex = 74;
	            this.pictureBox_fire.TabStop = false;
        	    this.pictureBox_fire.Visible = false;
	            // 
        	    // label_percentage
	            // 
        	    this.label_percentage.AutoSize = true;
	            this.label_percentage.BackColor = System.Drawing.Color.Black;
        	    this.label_percentage.Font = new System.Drawing.Font("Book Antiqua", 12.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | 			System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(161)));
	            this.label_percentage.ForeColor = System.Drawing.Color.OrangeRed;
        	    this.label_percentage.Location = new System.Drawing.Point(212, 80);
	            this.label_percentage.Name = "label_percentage";
	            this.label_percentage.Size = new System.Drawing.Size(70, 24);
        	    this.label_percentage.TabIndex = 94;
	            this.label_percentage.Text = "000.00%";
        	    this.label_percentage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
	            this.label_percentage.Visible = false;
	            // 
        	    // label_time
	            // 
        	    this.label_time.AutoSize = true;
	            this.label_time.BackColor = System.Drawing.Color.Black;
        	    this.label_time.Font = new System.Drawing.Font("Book Antiqua", 12.75F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | 				System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((System.Byte)(161)));
	            this.label_time.ForeColor = System.Drawing.Color.Lime;
        	    this.label_time.Location = new System.Drawing.Point(134, 80);
	            this.label_time.Name = "label_time";
        	    this.label_time.Size = new System.Drawing.Size(67, 24);
	            this.label_time.TabIndex = 95;
        	    this.label_time.Text = "00:00:00";
	            this.label_time.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
        	    this.label_time.Visible = false;
	            // 
        	    // frmCPU_Stretcher
	            // 
        	    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
	            this.BackColor = System.Drawing.Color.White;
        	    this.ClientSize = new System.Drawing.Size(449, 300);
	            this.Controls.Add(this.label_percentage);
        	    this.Controls.Add(this.label_time);
	            this.Controls.Add(this.btn_stop);
        	    this.Controls.Add(this.btn_fire);
	            this.Controls.Add(this.pictureBox_fire);
        	    this.Cursor = System.Windows.Forms.Cursors.Arrow;
	            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        	    this.Location = new System.Drawing.Point(270, 20);
	            this.MaximizeBox = false;
        	    this.MinimizeBox = false;
	            this.Name = "frmCPU_Stretcher";
        	    this.ShowInTaskbar = false;
	            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
        	    this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
	            this.Text = "CPU stretcher";
        	    this.TopMost = true;
	            this.ResumeLayout(false);	
                }
		private void btn_fire_Click(object sender, System.EventArgs e)
		{
			Thread t1 = new Thread(new ThreadStart(burn_in));
			pictureBox_fire.Visible=true;
        		btn_stop.Enabled=true;
			btn_fire.Enabled=false;
			label_time.Visible = true;  // This *****ING label is appeared during execution but if we move
	        	t1.Start();                 // the command in burn_in() routine is not appeared GKR, GKR, GKR
		}   
		private void burn_in()
		{
        	    label_percentage.Visible = true;       // WTF this command does not work?????
	            System.Threading.Thread.Sleep(3000);   // Assume this command is the burn-in code
	            btn_stop.Enabled = false;
        	    label_percentage.Visible = false;
	            label_time.Visible = false;            // This command works GKR......
        	    pictureBox_fire.Visible = false;
	            btn_fire.Enabled = true;
		}
	}
}
The program was written in Visual C# 2003.
Yesterday I compiled the source code with Visual Studio 2005.
All OK, no warnings.
Then running the program I encountered problems (that's why I added comments).
Why??????
I am very confused........
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 21st March, 2007, 08:15 AM
MrSeanKon's Avatar
OcBible Creator
 
Join Date: June 2005
Location: Athens in love with Anna :)
Posts: 788

Angry

GKR I think they bother us...
The problem solved adding two commands:
Code:
...........
label_percentage.Visible=true;
label_percentage.Visible=false;
t1.Start();
...........
__________________

Last edited by MrSeanKon; 21st March, 2007 at 08:15 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid Warning Labels Gizmo Mookydooky's Just for laughs! 32 17th February, 2006 04:35 PM
New HDD not visible in Windows? Lazgoat General Hardware Discussion 7 21st August, 2004 01:32 AM
FF code Pooface EPoX MotherBoards 2 22nd July, 2003 04:41 AM
Anyone know what the P1 code is? MichaelMuck EPoX MotherBoards 3 2nd March, 2003 12:28 PM
New Warning Labels on Alcohol. mookydooky Mookydooky's Just for laughs! 1 10th August, 2002 09:11 AM


All times are GMT +1. The time now is 12:16 PM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0