Click here to Skip to main content
15,880,608 members
Home / Discussions / Windows Forms
   

Windows Forms

 
AnswerRe: problems about datagridview in C# winforms Pin
nelsonpaixao7-Nov-08 14:37
nelsonpaixao7-Nov-08 14:37 
QuestionVSTO Application Deployment Pin
tozy3-Nov-08 19:15
tozy3-Nov-08 19:15 
Questionhow to disable paste event for a textbox Pin
lakshmichawala3-Nov-08 19:07
lakshmichawala3-Nov-08 19:07 
AnswerRe: how to disable paste event for a textbox Pin
dan!sh 3-Nov-08 21:00
professional dan!sh 3-Nov-08 21:00 
AnswerRe: how to disable paste event for a textbox Pin
Thomas Stockwell6-Nov-08 8:40
professionalThomas Stockwell6-Nov-08 8:40 
QuestionImproving MSDN DataGridView VirtualMode with caching sample code Pin
AndrusM3-Nov-08 9:23
AndrusM3-Nov-08 9:23 
Questionprinting results from a datagrid using visual studio 2003- 2005 IDE Pin
topzturvins073-Nov-08 4:24
topzturvins073-Nov-08 4:24 
Questionissue with progress bar Pin
gtag2-Nov-08 22:32
gtag2-Nov-08 22:32 
There are two issues :
1. My windows application contain many number of controls like, buttons, textboxes,checkboxes etc..
Application is very slow while execution and even for any button click event application hangs for a while(atleast 8 seconds).

Used panel and group box but same status.

2.While execution i have to show one progress bar for particular button click event. And need to increment progress bar in sync or simultaneously with button click event execution.

Example: (only a part of the code i am writing here in blog):

Two forms form1 & form2:

on form1 button click event some code is executed.
say form1 code:

form2 trs = new form2();
btn_click
{
trs.Show();
trs.Owner = this;
trs.go(this);
Thread thred = new Thread(new ParameterizedThreadStart(trs.go));
string strngmain = "a";
....do something........(here actual code executes, while this executes,i want to show the status in progress bar, so while execution i am adding one char to string variable strngmain)

}

written one method in 1st form:
public void UpdateProgress(int progress)
{
if (InvokeRequired)
Invoke((MethodInvoker)delegate() { trs.progressBar1.Value = progress; });
else
trs.progressBar1.Value = progress;
}
where 'trs' is a instance of form2 declared in form1.

No. of times 'a' char is added in single button click event to a string declared called "strngmain". And depending upon each char progress bar status should get incremented in 2nd form.

Form2: It contains one progress bar which should increment depending upon the button click event execution:

Code in form2:
form2_load
{
progressbar1.show();
}
public void go(object param1)
{
MainForm form = (MainForm)param1;
string strng;
srtng = ((MainForm)this.Owner).trans_complete;
foreach(char c in strng)
{
form.UpdateProgress(10);
Thread.Sleep(10);
}
}

But the above code is not working correctly , progress bar is not incrementing in sync with mainform's button click event code execution.

Any help appreciated.

Thanks in advance.
AnswerRe: issue with progress bar Pin
Thomas Stockwell3-Nov-08 1:53
professionalThomas Stockwell3-Nov-08 1:53 
GeneralRe: issue with progress bar Pin
gtag4-Nov-08 23:36
gtag4-Nov-08 23:36 
QuestionSplitContainer panel displays garbage when resized Pin
gschmidt9581-Nov-08 19:48
gschmidt9581-Nov-08 19:48 
AnswerRe: SplitContainer panel displays garbage when resized Pin
Thomas Stockwell3-Nov-08 1:55
professionalThomas Stockwell3-Nov-08 1:55 
GeneralRe: SplitContainer panel displays garbage when resized Pin
Greg Schmidt3-Nov-08 2:50
Greg Schmidt3-Nov-08 2:50 
Questionstart windows app on file print click Pin
balu1234530-Oct-08 22:53
balu1234530-Oct-08 22:53 
QuestionHow can set specific path for chm file Pin
tozy30-Oct-08 20:42
tozy30-Oct-08 20:42 
Question[Deployment] Immediately run application after setup Pin
Accius30-Oct-08 7:37
Accius30-Oct-08 7:37 
QuestionRe: [Deployment] Immediately run application after setup Pin
led mike31-Oct-08 4:39
led mike31-Oct-08 4:39 
QuestionPrint a form Pin
shir129-Oct-08 22:22
shir129-Oct-08 22:22 
AnswerRe: Print a form Pin
Giorgi Dalakishvili29-Oct-08 22:40
mentorGiorgi Dalakishvili29-Oct-08 22:40 
Questionwin app to silverlight? Pin
codeflat29-Oct-08 2:12
codeflat29-Oct-08 2:12 
AnswerRe: win app to silverlight? Pin
Simon P Stevens29-Oct-08 5:57
Simon P Stevens29-Oct-08 5:57 
QuestionPlug-in for Outlook using C# Pin
A.Asif28-Oct-08 18:47
A.Asif28-Oct-08 18:47 
RantRe: Plug-in for Outlook using C# Pin
Paul Conrad3-Nov-08 5:04
professionalPaul Conrad3-Nov-08 5:04 
QuestionDataGrid in CF 2.0 Pin
Member 62799727-Oct-08 17:10
Member 62799727-Oct-08 17:10 
QuestionTrackBar appearance inconsistency Pin
John Whitmire27-Oct-08 11:12
professionalJohn Whitmire27-Oct-08 11:12 

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.