Click here to Skip to main content
15,890,609 members
Home / Discussions / C#
   

C#

 
AnswerRe: Maximum number of columns that can be added in a dataset table Pin
thatraja27-Nov-11 23:35
professionalthatraja27-Nov-11 23:35 
AnswerRe: Maximum number of columns that can be added in a dataset table Pin
Mycroft Holmes27-Nov-11 23:39
professionalMycroft Holmes27-Nov-11 23:39 
GeneralRe: Maximum number of columns that can be added in a dataset table Pin
thatraja28-Nov-11 0:10
professionalthatraja28-Nov-11 0:10 
AnswerRe: Maximum number of columns that can be added in a dataset table Pin
Kabwla.Phone28-Nov-11 3:04
Kabwla.Phone28-Nov-11 3:04 
QuestionHow to update the Form 's progress bar from different calss Pin
ptr_Electron27-Nov-11 21:45
ptr_Electron27-Nov-11 21:45 
AnswerRe: How to update the Form 's progress bar from different calss Pin
Wayne Gaylard27-Nov-11 22:02
professionalWayne Gaylard27-Nov-11 22:02 
GeneralRe: How to update the Form 's progress bar from different calss Pin
ptr_Electron28-Nov-11 0:54
ptr_Electron28-Nov-11 0:54 
AnswerRe: How to update the Form 's progress bar from different calss Pin
Luc Pattyn27-Nov-11 22:18
sitebuilderLuc Pattyn27-Nov-11 22:18 
ptr_Electron wrote:
void DoaLengthyJob()
        {
            int i=0;
            while (////)
            {
 
                // time consuming operation
                Form2 f = new Form2;
                f.ProgressBar =i;
                i++
 
            }
 

        }


There are a couple of issues here:

1. You are not showing the form at all (maybe you ar showing another instance of the Form2 class, but that doesn't help, they are distinct, and so are the progress bars)

2. a lengthy job should not run on the main thread as it would block the GUI, resulting in poor behavior: no window repainting, unable to move/resize the window, etc. You should use a different thread for long operations, a BackgroundWorker could help here.

3. And then, another thread shouldn't directly create or touch WinForm Controls. You need some kind of Invoke, see here[^].

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: How to update the Form 's progress bar from different calss Pin
ptr_Electron28-Nov-11 0:53
ptr_Electron28-Nov-11 0:53 
AnswerRe: How to update the Form 's progress bar from different calss Pin
Luc Pattyn28-Nov-11 1:02
sitebuilderLuc Pattyn28-Nov-11 1:02 
QuestionMulti-lingual possessive case Pin
Tyrone Watt27-Nov-11 21:39
Tyrone Watt27-Nov-11 21:39 
AnswerRe: Multi-lingual possessive case Pin
Łukasz Nowakowski27-Nov-11 23:04
Łukasz Nowakowski27-Nov-11 23:04 
GeneralRe: Multi-lingual possessive case Pin
Tyrone Watt27-Nov-11 23:20
Tyrone Watt27-Nov-11 23:20 
GeneralRe: Multi-lingual possessive case Pin
Łukasz Nowakowski27-Nov-11 23:25
Łukasz Nowakowski27-Nov-11 23:25 
QuestionAnimation for an Agent in C# Pin
macantony27-Nov-11 7:16
macantony27-Nov-11 7:16 
AnswerRe: Animation for an Agent in C# Pin
Eddy Vluggen27-Nov-11 11:39
professionalEddy Vluggen27-Nov-11 11:39 
QuestionRe: Animation for an Agent in C# Pin
Luc Pattyn27-Nov-11 11:46
sitebuilderLuc Pattyn27-Nov-11 11:46 
AnswerRe: Animation for an Agent in C# Pin
Mark Salsbery27-Nov-11 16:19
Mark Salsbery27-Nov-11 16:19 
GeneralRe: Animation for an Agent in C# Pin
Richard Andrew x6427-Nov-11 16:29
professionalRichard Andrew x6427-Nov-11 16:29 
GeneralRe: Animation for an Agent in C# Pin
macantony28-Nov-11 1:12
macantony28-Nov-11 1:12 
AnswerRe: Animation for an Agent in C# Pin
Eddy Vluggen28-Nov-11 8:30
professionalEddy Vluggen28-Nov-11 8:30 
QuestionWinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
BillWoodruff27-Nov-11 2:47
professionalBillWoodruff27-Nov-11 2:47 
AnswerRe: WinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
OriginalGriff27-Nov-11 3:16
mveOriginalGriff27-Nov-11 3:16 
GeneralRe: WinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
BillWoodruff27-Nov-11 4:06
professionalBillWoodruff27-Nov-11 4:06 
GeneralRe: WinForms: visual clipping of docked controls added at run-time to Panel with AutoScroll=true Pin
OriginalGriff27-Nov-11 4:09
mveOriginalGriff27-Nov-11 4:09 

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.