473,765 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

statusstrip & progressbar,tim ers in windows application

3 New Member
i want to use statusstrip, Progressbar,tim ers 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 6512
jjvainav
25 New Member
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
4413
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 the Timers messages are not posted Even on Windows XP I have the similar problem Any pointers will be appreciated
8
19633
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. pBar1.Minimum = 1; // Set Maximum to the total number of files to copy. pBar1.Maximum = 4; //filenames.Length;
0
1381
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 this a bug?
2
11124
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 controls on the form, I want the ProgressBar to scroll in marquee mode. However, I cannot seem to get this to work. I set the StatusStripLabel to the text I want such as "Updating data..." and then set the ProgressBar's Style property to Marquee...
1
21032
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
4484
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 was using a Label and ProgressBar Located in the form itself but for the sake of appearance I decided it would look better to create a StatusStrip. I relocated the uiFileCreationLabel and uiFileCreationProgressBar to the Status strip as a StatusLabel...
10
5850
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 like it's docked to "Fill" inside the StatusStrip and force the progress bar to behave like it's docked to "Right" inside the StatusStrip. Unfortunately I do not see any way to accomplish this using just one StatusStrip control. Does anyone...
9
7294
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 spend them learning C# .Net. I've done some smaller programming assignments and decided now to try a larger program. I'm trying to create a basic game where you the "hero" meets "villains" and monsters in an arena. I want the fighting to be like...
8
3373
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 on a network for files and then copies these files to another location (on the network) AND then updates a record in the database. The file copying is performed before the database update because the file system is not transactional. The code...
0
10163
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.