|
Richard Hartness wrote: ase statements are terminated with the C# keyword break. Unde
I guess you could have a boolean flag as part of the while loop, bool isBreakingFromDefault, and just set that flag to true when you break from default. When the while loop sees that flag as true, break from the while loop as well.
FWIW, I think the switch construct is butt ugly and often confusing. I'd much rather see a few if/elses.
|
|
|
|
|
Judah Himango wrote:
FWIW, I think the switch construct is butt ugly and often confusing. I'd much rather see a few if/elses.
Wow - I think the reverse. They are, of course, the same thing in the end.
Christian Graus - C++ MVP
|
|
|
|
|
Judah Himango wrote: I think the switch construct is butt ugly and often confusing. I'd much rather see a few if/elses.
the switch is excellent, but not really usable in every case, but so are if/elses. Just use the right tool for the job .
|
|
|
|
|
Even though you already mentioned this, it's short, and pretty much the standard:
bool bContinue = true;
while( myOtherCriteria && bContinue)
{
case...
...
...
otherwise:
bContinue = false;
}
|
|
|
|
|
To be weirder, you can throw an exception...
|
|
|
|
|
Richard Hartness wrote: C# seems to break down a little.
Actually, I don't think this has anything to do with C# per se. C and C++ work the same way.
/ravi
|
|
|
|
|
|
Richard Hartness wrote: awesome New Years resolution
Sadly, yet to be realized.
/ravi
|
|
|
|
|
Hi,
I have a typed dataset which I bind a DataGridView to, and I have set the caption property of the columns in my dataset.
However, when binded, the datagridview is showing the ColumnName value, not the Caption.
Am I doing something wrong? I thought that setting Caption would make the DataGridView use it.
Sorry if this has been asked before, search didnt yield any results
|
|
|
|
|
Try setting each columns header text in the DataGridView properties.
led mike
|
|
|
|
|
So, you've created the columns, and not AutoGenerated them?
|
|
|
|
|
Nope, columns are all autogenerated, but the header text displays the column name, not the value set in the caption property...and according to help, caption should be displayed.
|
|
|
|
|
The easy way is to make templated columns, and not autogen.
|
|
|
|
|
I am trying to make a datagrid in a windows application editable. How can I add the edit column in the designer? Any helpful hints on that or sources?
thanks
-- modified at 11:27 Wednesday 22nd November, 2006
|
|
|
|
|
Naji.A wrote: Any helpful hints on that or sources?
www.CodeProject.com
msdn.microsoft.com
www.Google.com
led mike
|
|
|
|
|
Hi,
Check with this site. You may get something useful, http://www.datagridgirl.com/articles.aspx
Raja Raman S
Reuters India Pvt.Ltd.
Bangalore
|
|
|
|
|
Hi there,
I wanted to start developing some professional looking ui controls ( like these ) and just can't figure out how these have been developed and I don't want to include images in the project to mimick the look.
Can someone give me an advice where to start or some good links or even books you recommend for this topic?
Sure I know that I can't create such good looking ui controls in a week I just want a helping hand guiding me into the right direction
Thanks in advance,
Cheers Chris
|
|
|
|
|
Petzold [^]covers fundamental topics well. At least he did back when I read him.
led mike
|
|
|
|
|
Most comprehensive ASP.NET books have at least one chapter on creating server controls, however this book, among others, specifically covers the subject.
Building ASP.NET Server Controls[^]
only two letters away from being an asset
|
|
|
|
|
Is this book also good if I'm going with WinForms Controls instead of ASP.Net Server Controls ?
|
|
|
|
|
|
Thank you!
I will try the first one
Cheers Chris
|
|
|
|
|
Hi,
I have created some settings file other than the main Settings.settings within my C# Win project. Before I used to see that, all new varaibles of all other settings files are being saved in the app.config file as an serializable XML. But in the past few days, I faced a problem with Configuration manager and I used to get error message "Configuration manager failed to load". After hassling for a while I found that, once I changed my project folder's name, the "Configuration manager error gone." but Now, I dont see the new variables in the app.config file any more. yet the settings vars are being saved in my computer somehow somewhere... I dont have any idea where are they being saved. I am worrid thinking that, if I ship my software to my client's pc, will it work in the same way by saving the settings variable somewhere in the PC without saving in app.config ?
Thanks and regards
Emran
|
|
|
|
|
Each project has a different settings file, make sure you are looking into the right one.
Other than that, as you already know, settings are always stored as XML, cant think of any other place they are stored in.
Hope that helps
|
|
|
|
|
Application setting persistence is thorougly described in "Application Settings Architecture" MSDN article (http://msdn2.microsoft.com/en-us/library/8eyb2ct1(VS.80).aspx), though, to say in short, they are stored in two parts: application-scope settings are stored in app.exe.config file that should be in the application folder, user-scope settings are stored in local user profile %InstallRoot%\Documents and Settings\username\Local Settings\Application data\CompanyName\ProductName\ProductVersion. The key thing is that this storage depends not only on product-name but on product build either. So, if you will leave apllication build number as it is set by default (1.0.*) or will change build number yourself location will change after build and your settings will be lost because they automatically migrate only when you use ClickOnce application deployment. Therefore you have to create your own settings migration mechanism or your own custom provider for settings storage to control your settings completely.
|
|
|
|