Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / September 2006

Tip: Looking for answers? Try searching our database.

Progressbar Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Guill - 12 Sep 2006 22:37 GMT
I have a MDI application that each ChildForm merges their respective
StatusStrips onto the ParentForm so that I can control the progressbar and
status text.  My problem is that the progressbar progression is not shown,
though its visible property is changed correctly.  Below is the code I use
(extra routines removed):

try
{
_topMost = Table;
statusProgress.Visible = true;
statusProgress.Value = statusProgress.Minimum;
statusLabel.Text = "Loading DataSet...";
progressTimer.Start();
Cursor.Current = Cursors.WaitCursor;

// Load Dataset at this point (This part works and is, I'm sure, causing
statusProgress to not update)

statusLabel.Text = string.Empty;
}
finally
{
Cursor.Current = Cursors.Default;
progressTimer.Stop();
statusProgress.Visible = false;
}

private void progressTimer_Tick(object sender, EventArgs e)
{
// Update progress bar
if ((statusProgress.Value + statusProgress.Step) > statusProgress.Maximum)
{
statusProgress.Value = statusProgress.Minimum;
}
else
{
statusProgress.Value += statusProgress.Step;
}
}
Claes Bergefall - 13 Sep 2006 15:38 GMT
I'm assuming you're using a System.Windows.Forms.Timer
That one isn't threaded and your main thread is busy loading the dataset so
no paint events are being handled (i.e. you're blocking your UI by loading
the dataset in the same thread).

Try loading your dataset with an instance of the
System.ComponentModel.BackgroundWorker class

  /claes

>I have a MDI application that each ChildForm merges their respective
> StatusStrips onto the ParentForm so that I can control the progressbar and
[quoted text clipped - 35 lines]
> }
> }
Nathan Guill - 13 Sep 2006 21:05 GMT
Okay, I'm now loading the dataset in a backgroundworker and have my
progressbar working in some fashion.  How do I get my DataGridView and
databound textboxes to show the loaded dataset? I've confirmed the dataset
is loaded by displaying a message box after the backgroundworker is finished
with the number of records.

> I'm assuming you're using a System.Windows.Forms.Timer
> That one isn't threaded and your main thread is busy loading the dataset so
[quoted text clipped - 45 lines]
> > }
> > }
Claes Bergefall - 14 Sep 2006 15:50 GMT
Set the DataMember and DataSource properties for your DataGridView

  /claes

> Okay, I'm now loading the dataset in a backgroundworker and have my
> progressbar working in some fashion.  How do I get my DataGridView and
[quoted text clipped - 59 lines]
>> > }
>> > }
Nathan Guill - 15 Sep 2006 14:12 GMT
That worked, but now my comboboxes (they are not in my datagridview) are not
populating.  I tried resetting the DataMembers and DataSources, but it
doesn't work.  Where else should I look?

> Set the DataMember and DataSource properties for your DataGridView
>
[quoted text clipped - 63 lines]
> >> > }
> >> > }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.