473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

statusstrip & progressbar,timers in windows application

i want to use statusstrip, Progressbar,timers in my windows application but for some reason i am not being able to use these so i need help ,


can any one help me by giving the code for how to use these control in windows application
Mar 1 '08 #1
1 6479
This should get you started

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8.  
  9. namespace WindowsApplication2
  10. {
  11.     public class Form1 : Form
  12.     {
  13.         private System.Windows.Forms.StatusStrip statusStrip1;
  14.         private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1;
  15.         private System.Windows.Forms.Timer timer1;
  16.  
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.             timer1.Start();
  21.         }
  22.  
  23.         /// <summary>
  24.         /// Required method for Designer support - do not modify
  25.         /// the contents of this method with the code editor.
  26.         /// </summary>
  27.         private void InitializeComponent()
  28.         {
  29.             this.statusStrip1 = new System.Windows.Forms.StatusStrip();
  30.             this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
  31.             this.timer1 = new System.Windows.Forms.Timer();
  32.             this.statusStrip1.SuspendLayout();
  33.             this.SuspendLayout();
  34.             // 
  35.             // statusStrip1
  36.             // 
  37.             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
  38.             this.toolStripProgressBar1});
  39.             this.statusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
  40.             this.statusStrip1.Location = new System.Drawing.Point(0, 404);
  41.             this.statusStrip1.Name = "statusStrip1";
  42.             this.statusStrip1.Size = new System.Drawing.Size(508, 22);
  43.             this.statusStrip1.TabIndex = 0;
  44.             this.statusStrip1.Text = "statusStrip1";
  45.             // 
  46.             // toolStripProgressBar1
  47.             // 
  48.             this.toolStripProgressBar1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
  49.             this.toolStripProgressBar1.Name = "toolStripProgressBar1";
  50.             this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 16);
  51.             // 
  52.             // timer1
  53.             // 
  54.             this.timer1.Interval = 500;
  55.             this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
  56.             // 
  57.             // Form1
  58.             // 
  59.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  60.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  61.             this.ClientSize = new System.Drawing.Size(508, 426);
  62.             this.Controls.Add(this.statusStrip1);
  63.             this.Name = "Form1";
  64.             this.Text = "Form1";
  65.             this.statusStrip1.ResumeLayout(false);
  66.             this.statusStrip1.PerformLayout();
  67.             this.ResumeLayout(false);
  68.             this.PerformLayout();
  69.  
  70.         }
  71.  
  72.         private void timer1_Tick(object sender, EventArgs e)
  73.         {
  74.             toolStripProgressBar1.PerformStep();
  75.             if(toolStripProgressBar1.Value == toolStripProgressBar1.Maximum)
  76.             {
  77.                 timer1.Stop();
  78.             }
  79.         }
  80.     }
  81. }
  82.  
Mar 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Lak | last post by:
Hi I have a regular DLL deriverd from CWinApp that uses a Timer to tick at 10m SetTimer(NULL,1,10,TimerProc I developed a windows UI application that works fine. When I created a console app...
8
by: needin4mation | last post by:
Please consider: foreach (ListViewItem item in listViewFiles.Items) { // Display the ProgressBar control. pBar1.Visible = true; // Set Minimum to 1 to represent the first file being copied....
0
by: Jim Hubbard | last post by:
When you add a StatusStrip to a WinForm and add a Progressbar to the StatusStrip, setting the Progressbar alignment to "Right" does not move the Progressbar to the right on the Statusbar. Is...
2
by: =?Utf-8?B?QWFyb24=?= | last post by:
Since some controls such as the DataGridView take a long time to update themselves when performing certain tasks, I have added a StatusStrip with a ProgressBar on it. While I am updating the...
1
by: Carla Simeoni | last post by:
I added a StatusStrip "Sstrip1" to a Form "Form1". In the procedure private void Form1_Load(...) I added the following statement: Sstrip1.Text = "Text in my StatusStrip";
3
by: SniperDemon | last post by:
Background: The Program runs a query on a SQL Database, then it takes the gathered information and outputs it into an excel document and saves it to a specified location. Problem: Originally I...
10
by: hzgt9b | last post by:
Using VS2005 (.NET 2.0), VB.NET, I have a windows forms application. I have a StatusStrip containing a ToolStripStatusLabal and a ToolStripProgressBar. I want to force the status label to behave...
9
by: appelsinagurk | last post by:
Hi I'm fairly new to .Net programming so I'll try to explain my problem as easy as I can, and in advanced sorry for my poor english. I've got some spare hours where I work, so I've decided to...
8
by: Ollie Riches | last post by:
I'm looking into a production issue related to a windows service and System.Timers.Timer. The background is the windows service uses a System.Timers.Timer to periodically poll a directory location...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.