views:

1382

answers:

1

I want to set progress bar on my message box how to set ...progress bar property style have Marquee property..... Message box code is bellow.......

  MessageBox.Show("Data process please wait .", "Data progress ", MessageBoxIcon.Information);
+6  A: 

There is no way to do that using MessageBox. You need to implement your own Form which would look like a MessageBox, but contain a progress bar and/or anything else which you want to see there.

Rom
Can you tell me how to write custom Message box
Shamim
Derive from Form, place a Label and a ProgressBar on it. When you need only OK/Cancel place the Buttons, too - if you need dynamic button combinations it gets more complicated. In the ButtonClicked events set the DialogResult property ...
tanascius
You can set the dialogresult directly on the button. so 'ok' has DialogResult.OK and 'cancel' has DialogResult.Cancel. The Propery you have to set is 'DialogResult' and you can set it using the Properties-Windows for the button.
crauscher
Yes, you are right - and you even get the standard behaviour - ESC = close, Enter = Ok ...
tanascius
Yes, what tanascius said: derive from Form, add your controls, etc.
Rom