In Focus
Jabalpur Chapter - Windows 8 Developers Day
Delhi Chapter Hands On June 22: Limited Seats Register Now
Kolkata Chapter Developer Day: May 25
C# Corner Delhi Chapter Meet, May-18, 2013 Official Recap
Istanbul Chapter May 2013 2nd Seminar Announced : Learn WinJS, Windows Store, MVC
Email :
Password :
Remember me?
Forgot password
Contribute
An Article
A Blog
A News
A Video
A Link
An Interview Question
Ask a Question
TECHNOLOGIES
.NET 4.5
Current Affairs
Leadership
SharePoint 2010
Web Development
.NET Assemblies
Databases & DBA
Learn .NET
SharePoint 2013
Web Services in C#
ADO.NET in C#
Design & Architecture
LightSwitch 2012
Silverlight with C#
Windows 8
AJAX in C#
Exception Handling C#
LINQ
Smart Devices
Windows Azure
Android Programming
Graphics Design
Mobile & Embedded
SQL
Windows Controls C#
Articles C#
Hardware
Office 2013
SQL Server 2012
Windows Forms C#
ASP.NET Controls in C#
How do I
OOP/OOD
Testing
Windows Phone 8
ASP.NET MVC with C#
HTML 5
Operating Systems
TypeScript
Windows Server 2012
ASP.NET Programming
Internet & Web
PHP
Visual C#
Windows Store Apps
C# Language
iPhone/iPad
Products
Visual Studio .NET
Workflow Foundation in C#
C# Tutorials
Java
Project Management
Visual Studio 2010
WPF
C, C++, MFC
Java and .NET
Reports using C#
Visual Studio 2012
XAML
Career Advice
JavaScript, CSS
Robotics & Hardware
WCF with C#
XML
Chapters
JQuery
Security in .NET
Request a new Category
|
View All
ANSWERS
BLOGS
VIDEOS
INTERVIEWS
BOOKS
LINKS
NEWS
CHAPTERS
CAREER ADVICE
according to my personal opinin using progress bar while submiting the data or reciving the data means the time wastage of end user
Posted by
Vithal Wadje
on
Jan 24, 2013
Hallo, ich versuche gerade eine ProgressBar in einer eigenen WinForm zu erstellen. Hier mein Ansatz: C#-Code: public partial class RIM_ProgressBar : Form { Thread _thread; int _val; public int Value { set {this._val=value; } get { return this._val; } } public RIM_ProgressBar(int min, int max, int actual) { InitializeComponent(); progressBar1.Minimum = min; progressBar1.Maximum = max; progressBar1.Value = actual; _val = actual; } private void RIM_ProgressBar_Load(object sender, EventArgs e) { _thread = new Thread(new ThreadStart(load)); _thread.Start(); } public void load() { progressBar1.Value = _val; statusStrip1.Text = progressBar1.Value.ToString() + "%omplete"; // Thread.Sleep(10); } public void changeValue(int val) { this._val = val; } } So ruf ich das auf: C#-Code: RIM_ProgressBar rProgBar = new RIM_ProgressBar(0, 100, 0); rProgBar.Show(); for (int i = 0; i < 100; i++) { rProgBar.Value = i; Thread.Sleep(10); } Es funktioniert nicht...
Posted by
Puma D Ace
on
Jul 06, 2011
Great article! Here you find another nice article about how to implement a WPF progress dialog: http://www.parago.de/2011/04/how-to-implement-a-modern-progress-dialog-for-wpf-applications/
Posted by
Jürgen Bäurle
on
Jun 18, 2011
http://www.csharphelp.com/wp-content/themes/twentyten/images/headers/path.jpg
Posted by
Nasir Uddin
on
Apr 28, 2011
For the Below Code, I want to add a progress bar: while data inserted into the another table. It takes 1 to 2 mins, for this I want to show the progress bar till the data completely not inserted
private void button1_Click_1(object sender, EventArgs e)
{
SqlConnection conn = null;
try
{
conn = new SqlConnection(@"Data Source=HAIDER-IT;Initial Catalog=csoft;Integrated Security=True");
conn.Open();
SqlCommand cmd = new SqlCommand("Search",conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 1800;
cmd.Parameters.Add("@P_prd", SqlDbType.VarChar, 50).Value = "11";
cmd.Parameters.Add("@P_rep", SqlDbType.VarChar, 50).Value = "31";
cmd.Parameters.Add("@P_yy", SqlDbType.VarChar, 50).Value = "2008";
cmd.Parameters.Add("@P_mm", SqlDbType.VarChar, 50).Value = "04";
cmd.Parameters.Add("@P_HS", SqlDbType.VarChar, 50).Value = "1";
int I = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}
MessageBox.Show("Data Inserted");
}
Posted by
Sharique Imam
on
Sep 08, 2010
well
Posted by
jchbjsnc
on
May 19, 2010
Hi..............
Thank you Mahesh Chand Sir for download files progrs_br1.zip.
From
Manoj kumar
Dehradun (UA)
+91-9458106336
Posted by
Manoj kumar
on
May 07, 2010
To understand how the C# Progress Bar works, read this
post
.
Posted by
Ali Badereddin
on
Feb 11, 2010
Thank u
Posted by
arun chaturvedi
on
Jan 01, 2010
Progress bar is simple, is it for web browser or just basic load of an event?
Posted by
mark hughes
on
Dec 24, 2009
Thanx pal for making it currect ,well the progressbar is working fine but the stop button is not working .I know calling abort in thread is not fair ,,can u make that stop button currect ...
Posted by
Sreejith Thampy
on
Apr 19, 2009
Hi I m Rehan Qureshi.........This code solved my big problems about the working of progress bar without experience........thank for that
Posted by
Muhammad Rehan Qureshi
on
Mar 21, 2009
Ok my freind you have made a serious mistake, you have made an illegal cross threaded manipulation, I explain, you have invoked the both progressbar1 and statusbar1 outside the thread where they have been created. As a solution to this problem you have to create a delegate that points to a method that perform the controls' modifications (progress for the progress bar and text change for the statusbar) and then invoke this delegate inside the thread method like this
public Form1()
{
InitializeComponent();
}
//The thread
Thread st;
//The delegate instance
Progress p;
//The delegate class
public delegate void Progress();
private void Form1_Load(object sender, EventArgs e)
{
st = new Thread(new ThreadStart(load));
p = new Progress(Perform);
}
//The method that will be pointed by the delegate instance
public void Perform()
{
for (int i = 0; i <= 100; i = i + 1)
{
progressBar1.Increment(i);
statusStrip1.Text = progressBar1.Value.ToString() + "%omplete"; Thread.Sleep(10);
}
DialogResult dlg = MessageBox.Show("Do you want to close this window", "Do you want to exit this window", MessageBoxButtons.OKCancel);
if (dlg == DialogResult.OK) Application.Exit();
}
//The thread method
public void load()
{
Form1 form = this;
form.Invoke(p);
}
//The button that triggers the thread
private void button1_Click(object sender, EventArgs e)
{
st.Start();
//To avoid thread multi invocation
button1.Enabled = false;
}
Posted by
Bechir Bejaoui
on
Mar 18, 2009
its the code for progress bar thank you
Posted by
Sreejith Thampy
on
Mar 16, 2009
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form { Thread st; public Form1() { InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
st = new Thread(new ThreadStart(load));
}
public void load()
{
for (int i=0;i<=100;i=i+1)
{
progressBar1.Increment(i);
statusStrip1.Text = progressBar1.Value.ToString() + "%omplete"; Thread.Sleep(500); }
}
private void progressBar1_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
st.Start();
}
private void button2_Click(object sender, EventArgs e)
{
if (st.IsAlive)
{
st.Abort();
} } } }
Posted by
Sreejith Thampy
on
Mar 16, 2009
Hi, This is Surendra Gurjar, I learn from the this tutorial and it is very useful.
Posted by
Surendra Gurjar
on
Jan 28, 2009
hello i have problem to execute progress bar with oracel connection this is my code: Timer1.Start() Try Dim cn As New OracleConnection("Password=password;User ID=dph;Data Source=creative;Persist Security Info=True") cn.Open() cn.Close() Catch ex As Exception MsgBox("sdsqdqdq") End Try Timer1.Stop() think you
Posted by
aissam cheikh
on
Jul 26, 2007
Posted by
Mahadevakumar G
on
May 03, 2007
PREMIUM SPONSORS
DynamicPDF Developer Components
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
TRENDING UP
Top 10 HTML5 Interview Questions
How to Enable Sign in as Different User Option in SharePoint 2013
How to Select Multiple Rows in Grid Using LightSwitch 2012
Find and Delete Duplicate Records From SQL Table
Custom Paging With GridView in ASP.NET 4.5
Encrypt and Decrypt in SQL Server: Part 2
Native Windows Dynamic Link Libraries (DLLs)
Introduction To Serialization In Java
Resolving Dependency Using Ninject
Learn Object Oriented Programming Using C#: Part 3
View All
Follow @twitterapi
Poll
Result
All Polls
What is the best product to build Mobile apps?
What is the best product to build Mobile apps
PhoneGap
Icenium
Xamarin Studio
KendoUI Mobile
JQueryMobile
Native iOS/Android
What is the best product to build Mobile apps
Options
Votes
%
PhoneGap
3
3.45
Icenium
0
0.00
Xamarin Studio
3
3.45
KendoUI Mobile
3
3.45
JQueryMobile
67
77.01
Native iOS/Android
11
12.64
Total
87
100%