Richard Smith wrote: Does anyone have any hints as how to implement a progress bar for a status panel?
I think you can host controls inside a statusbar panel. But it would probably be better to do a custom statusbar...
Typically a StatusBar control consists of StatusBarPanel objects, each of which displays text and/or an icon. You can also provide owner-drawn panels to provide custom panels such as a progress bar or a series of images that displays the state of your application.
The default StatusBar has no panels. To add panels to a StatusBar you can use the Add method of the StatusBar.StatusBarPanelCollection class that is accessible through the Panels property of the control. You can also use the StatusBar.StatusBarPanelCollection object provided through the Panels property to remove panels from the control and access a specific StatusBarPanel object to manipulate the panel.
Now just add the progress bar to the panel
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
Basically, you can put the progressbar control on the status bar on the design
But, as you know, this progressbar parent is the Form.
So, if we change the size of the form, we also have to change the location
of the progress bar.
After we get Top and Left of the status bar, we easily update the location
of the progress bar.
(However, I didn't check the functionality of the progress bar.)
Please, don't send me your email about your questions directly.
Have a nice day!
Sonork - 100.10571:vcdeveloper
You might consider what Masaaki has suggested, however I tried something extremely simple which I believe take a lot of the pain out of it.
Basically add a status bar to your form, then drag a progress bar onto the status bar placing it in the lower left hand corner of the status bar, you do not need to add a panel to the status bar. With the progress bar item selected go to the Anchor property and click on both the Bottom and Left "bars". The text value inside the Anchor property should read "Bottom, Left". Run your app, the progress bar will stay in sync with you form at all times now.
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
When i run this program,it says Must declare the variable '@Country'.
What should i do.
string selectSQL = "SELECT CustomerID, CompanyName FROM ustomers WHERE Country = @Country AND City = @City";
OleDbConnection nwindConn = new OleDbConnection("Provider=SQLOLEDB;Data Source=localhost;" +
"Integrated Security=SSPI;Initial Catalog=northwind;");
OleDbDataAdapter custDA = new OleDbDataAdapter();
OleDbCommand selectCMD = new OleDbCommand(selectSQL, nwindConn);
custDA.SelectCommand = selectCMD;
// Add parameters and set values.
selectCMD.Parameters.Add("@Country", OleDbType.VarChar, 15).Value = "UK";
selectCMD.Parameters.Add("@City", OleDbType.VarChar, 15).Value = "London";
DataSet custDS = new DataSet();