|
While it's a good idea , I'd still call it a hack, unless xml-documentation is included with some explanation like Dave posted. Private members would not be reset, and the "OnCreate" event wouldn't fire on it's own. It might contain some "form magic" for setting the form up as well.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Well, I used the "hack" and it works just fine. I'm still going to experiment with other options based on everyone's input. But for my purposes, the "hack" gets the job done for now at least.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
I just re-load the page...
If you're currently on "MyPage.aspx" this will reset it.
Response.Redirect("MyPage.aspx", true);
|
|
|
|
|
Matt U. wrote: But I've always found it a bit tedious and time consuming to restore the UI to its initial state when the user saves an entry, for example.
Form.Controls.Clear();
InitializeComponent();
Alternatively, loop all controls using reflection (no, it ain't that slow, just a bit of an exercise to get recursion working) and clear them.
How do your edit-forms look like? Mine could be explained as a PropertyGrid on a dialog-form. It has an extra button called "reset", which just reloads a cloned object into the propertygrid.
It's not a real property-grid anymore; it's a custom control that behaves in a similar way (in code), but that renders a more 'traditional' winform.
I choose this architecture out of convenience; a single modification in the object, and it's pushed to a Memento-pattern (undo/redo stack). When closing, the content of both get serialized and saved. When loaded, both are restored - it makes users happy when they find out that they can "undo" yesterday's changes, even if the PC was turned of in the mean time.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: they can "undo" yesterday's changes
THAT, is hard freeking core, dude. I like it
As noted before though, I think the only way to make it behave like a 'new' form is to have it be a new form... but if it's your main form or something, that might require hacking program.cs.
|
|
|
|
|
Jasmine2501 wrote: I like it Tx
Can be a bit confusing though; most users expect an empty undo/redo-list when they launch an application.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
If you are using wpf with MVVM then all you have to do is make the VM serializable, and save it.
|
|
|
|
|
hi my friends
i 'll create an Attendance System in c sharp and a table in sql
but i do not know this table form.
plz help this segment
tnx
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Try giving an example of what is giving you a problem.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
behrouz shamlo wrote: i 'll create an Attendance System in c sharp and a table in sql but i do not know this table form. Is requested regularly, and there are quite some examples on the web. Simply download the Time Tracker Starter Kit[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This is more of a SQL considering you are looking for the structure of the table.
Try looking at samples across the internet to identify your fields correctly.
|
|
|
|
|
Abhinav S wrote: Try looking at samples across the internet to identify your fields correctly. I really dislike this MO; "go find a decent db on the netz".
Make a list of all the facts that your information-system needs to administer. Group the facts into logical groupings. Make sure every fact is atomic; if it's not, split it into multiple facts.
Iterate each group, giving it a descriptive name for the fact-collection. Now, iterate again, and find the fact (or facts) in each group that uniquely identifies a row/record/tupel/object whatever you call it. That's the fact(s) (or field(s) or column(s)) that represent the primary key.
Next, iterate all those tables/groups of facts again, and remove any fact that's not being identified by it's key.
This is called "database-design and normalization", and is a bit more work than described above.
And no, a housenumber "21a" does NOT consist of two facts, that's ONE fact. (Person has one housenumber, which happens to be a combination of two real-life things. These are, however, never used irl as separate facts, and hence, should not be modelled as different facts. Same goes for street and housenumber; if you need an address, reserve space for an address, not a street and a housenumber.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi
i dont Understand this part
please If possible give me a sample of this project
tanku
|
|
|
|
|
I already did, it was the link to the time-starter kit. Click the link, install, read the code. It's a full example.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Dear all developers around the world !
https://www.box.com/s/nhg8h6lxjyu2l2sv5zrv
i want to draw cube and have dynamic row and column..
example : column = 5 and row =3 it will generate like picture shown above..
please give me some source code and link if any...
thanks in advance..
|
|
|
|
|
|
Dear Abhinav S,
Deeply thanks for answer my question,
I want to customize draw a dash line across a surface cube like my picture link,,
but i'm so stupid I don know what to do, please point me or give me some coding ..thz
|
|
|
|
|
|
This innocuous project setting saved my butt. I had a nasty gotcha that for the life of me I couldn't see what was causing it. I'd copied a chunk of code and forgot to change a variable name. It compiled fine but was spooking me with a different value to what I expected. A light bulb switched on and I set the compile warnings as error option and lo, the compiler spewed an error that the variable might not have been assigned. Corrected, recompiled, all fine.
Our main app, the product of hacks, kicks, smack-downs over the years has literally 100 and 100s of warnings. If we ever get the time, we'll address them. That got me thinking: if only it was possible to set the warnings as errors on by default and password protect the setting so it can never be changed. It won't help us at this time but by golly, it's a darned useful setting!
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Well, I suppose if you use a TFS team build, you can alter the setting the project file before the build starts
|
|
|
|
|
You could send everyone a build command that contains the /warnaserror [^] tag.
This would help everyone use the same build command and making warnings appear as errors.
modified 2-May-13 6:15am.
|
|
|
|
|
It is indeed useful - I always run with it enabled.
You can make it the default in new projects by creating a template with it enabled though: Just create a new project, set the option on in the Properties (and make any other changes you want, such as references) then "File...Export Template..." and save it as a Project Template will mean it is enabled by default.
Don't know any way to lock it as read-only, I'm afraid!
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Thanks OG. It's one of those settings that's easy to overlook or neglect. The export template seems a very workable idea.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Welcome! I'm a big fan of automating things so I don't forget them...
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
You should have a non-developer (a configuration manager) who performs the test and production builds. I worked at a place where the first task the testers did was build the code and kick it back if there were problems.
|
|
|
|