Click here to Skip to main content
15,923,689 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Form with BackGroundWorkers Pin
Herman<T>.Instance26-Feb-08 4:18
Herman<T>.Instance26-Feb-08 4:18 
GeneralRe: Form with BackGroundWorkers Pin
Luc Pattyn26-Feb-08 4:49
sitebuilderLuc Pattyn26-Feb-08 4:49 
GeneralRe: Form with BackGroundWorkers [modified] Pin
Herman<T>.Instance26-Feb-08 5:00
Herman<T>.Instance26-Feb-08 5:00 
GeneralRe: Form with BackGroundWorkers Pin
Luc Pattyn26-Feb-08 5:14
sitebuilderLuc Pattyn26-Feb-08 5:14 
GeneralRe: Form with BackGroundWorkers Pin
Herman<T>.Instance26-Feb-08 6:03
Herman<T>.Instance26-Feb-08 6:03 
GeneralRe: Form with BackGroundWorkers Pin
Luc Pattyn26-Feb-08 6:09
sitebuilderLuc Pattyn26-Feb-08 6:09 
GeneralRe: Form with BackGroundWorkers Pin
Herman<T>.Instance26-Feb-08 23:01
Herman<T>.Instance26-Feb-08 23:01 
GeneralRe: Form with BackGroundWorkers Pin
Luc Pattyn26-Feb-08 23:50
sitebuilderLuc Pattyn26-Feb-08 23:50 
Hi,

moving the code that does DB access and DGV update to a Windows.Forms.Timer does not help at all:
the DB access, which is presumably the slow part of it, would block the GUI for as long as it takes.

The right approach would be to split the actions into:
1. some code that does the DB access but does not touch the GUI
2. code that updates the GUI

1. should be organized on a BGW, a thread or a timer (NOT a Windows.Forms.Timer), so it runs
independent of the GUI
2. must run on the GUI

I tend to use some intermediate data structure (say a generic list) to collect results and
prepare them for display (1), then pass it all on to some simple code that updates the GUI (2)
at high speed, hence never blocking the GUI thread and GUI for more than a few milliseconds.


digimanus wrote:
leaving them out the user cannot see how far the process is.


It is considered bad design to have a long winding operation that does not report progress
(the user may think the app died); and offering a cancel option (button) is recommended.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: Form with BackGroundWorkers [modified] Pin
Herman<T>.Instance27-Feb-08 1:15
Herman<T>.Instance27-Feb-08 1:15 
GeneralRe: Form with BackGroundWorkers Pin
Luc Pattyn27-Feb-08 4:04
sitebuilderLuc Pattyn27-Feb-08 4:04 
Questiondocking and floating window Pin
algates002724-Feb-08 19:28
algates002724-Feb-08 19:28 
GeneralRe: docking and floating window Pin
John_Adams24-Feb-08 22:04
John_Adams24-Feb-08 22:04 
GeneralInherited ComboBox Pin
Brady Kelly23-Feb-08 23:26
Brady Kelly23-Feb-08 23:26 
GeneralRe: Inherited ComboBox Pin
darkelv24-Feb-08 6:49
darkelv24-Feb-08 6:49 
GeneralRe: Inherited ComboBox Pin
Brady Kelly24-Feb-08 7:19
Brady Kelly24-Feb-08 7:19 
GeneralRe: Inherited ComboBox Pin
Brady Kelly26-Feb-08 1:48
Brady Kelly26-Feb-08 1:48 
GeneralRe: Inherited ComboBox Pin
Ed.Poore24-Feb-08 7:26
Ed.Poore24-Feb-08 7:26 
Generalrichtextboxes Pin
jazy121-Feb-08 21:29
jazy121-Feb-08 21:29 
GeneralRe: richtextboxes Pin
Christian Graus21-Feb-08 23:42
protectorChristian Graus21-Feb-08 23:42 
GeneralRe: richtextboxes [modified] Pin
jazy127-Feb-08 14:36
jazy127-Feb-08 14:36 
GeneralWinforms GUI / Design Guidelines Pin
James Spibey18-Feb-08 5:28
James Spibey18-Feb-08 5:28 
GeneralRe: Winforms GUI / Design Guidelines Pin
Brady Kelly18-Feb-08 6:02
Brady Kelly18-Feb-08 6:02 
GeneralRe: Winforms GUI / Design Guidelines Pin
N a v a n e e t h21-Feb-08 21:50
N a v a n e e t h21-Feb-08 21:50 
GeneralDeselecting ComboBoxes Pin
Brady Kelly18-Feb-08 2:21
Brady Kelly18-Feb-08 2:21 
GeneralRe: Deselecting ComboBoxes Pin
darkelv18-Feb-08 5:16
darkelv18-Feb-08 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.