|
You could check to see if the currently logged-in user is part of a particular group, and if so, just let them use the program. Otherwise, make them enter a password.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
I'm sure I'll get shouted at for this but OO is not the answer to everything. Your requirement looks very simple so keep it that way. If you really feel the need to objectify such a trivial requirement then break it down into logical components and go from there but you can end up over-engineering the solution. KISS - "keep it simple, stupid" works nearly every time.
Take a look at this, as well: Design Patterns[^].
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
I agree with you. I got halfway through typing the same response to the original post and then chickened out.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Henry Minute wrote: I got halfway through typing the same response to the original post and then chickened out.
Very good: I'm so used to being flamed that another roasting wouldn't hurt a bit!
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
Others have answered succinctly, but I must beg of you - don't crosspost. It makes it hard for people to follow answers.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Can anyone give me a link\TUTORIAL where i can able to draw the graph in a C# CRYSTAL RPORT.?
Thanks in advance..
|
|
|
|
|
lavate malllik wrote: Can anyone give me a link\TUTORIAL where i can able to draw the graph in a C# CRYSTAL RPORT.?
Google for the bit that I have made bold in your question. Correct your spelling of 'rport' first though.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Hi,
I have window application and windows service in C#. I want to display both application in System tray. I want to handle service like start ,service start up, stop using system tray . I would like to know how to create setup on project so that service can installed and it display in system try. with in system try I want to display one menu for open windows application.
I want to merger windows application and windows service in one application and want to create setup .When we install setup ,service should be installed and it should displayed in System try.
Please give me any idea !!!!!!
rajesh
|
|
|
|
|
Partial Answer.
Q: How to show an Icon for a running Windows Forms application?
A: Use the NotifyIcon control. You can find it in the Toolbox.
Steps:
Create a Windows forms application.
Add a "notifyIcon" control (.Net component).
Assign an icon to your notifyIcon control.
Make sure the notifyIcon.visible property is true.
HTH,
Marcelo
|
|
|
|
|
Hi every1.
I have a list in my project and theough it I add some data to a file. Now, I need to delete one record when user insert the approperiate UserId and Username.
Could you please advice me how I can do that. give me an example, please.
thx
|
|
|
|
|
What exactly are you having trouble with? Do you not know how to compare strings? Do you not know how to use a for loop? Are you having trouble with file access? If so, what kind of trouble specifically?
|
|
|
|
|
I've been wondering this for a while...
When I create something in the IDE - a form with buttons and boxes and other widgets - I usually spend a great deal of time setting the properties of each item. Obviously VS saves those properties somewhere, else it would be impossible to remember them after I close the session. But where? The Designer file only stores declarations; that's the first place I looked. But out of curiosity I've opened every file in Solution Explorer to locate these property settings, and I can't find a hint of them. Since I don't believe in magic, there must be some other way for the IDE to keep track of the properties I've selected. But where?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Roger Wright wrote: The Designer file only stores declarations; that's the first place I looked.
Look again. Make a button, set some properties, then open the designer file. Go to the button declaration and do a "Find All References" on it. The properties are set in the Designer file.
|
|
|
|
|
Ah, Luc hit it on the button - the regions needed expanding. It's all there. Thanks!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
In my projects, the properties all appear to be set in the *.Designer.cs files
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Silly me, I didn't expand the regions in the file... [whacks forehead]
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Hi Roger,
several files are created for you, next to the regular source files you create yourself:
for a solution abc there is an abc.sln file, it is a text file pointing to the projects;
and an abc.suo file, it is a hidden file, holding binary data.
for a form xyz there is a xyz.designer.cs or xyz.designer.vb holding declarations and initialization code;
there are settings files
there probably also are resource files, depending on your usage of resources.
Most of the simple stuff you enter through Visual Designer goes into the designer.cs/vb files.
As it uses regions, you'd have to open up the regions (or disable outlining) to see all of its content.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Wonderfully informative, as always Luc. Thanks! I forgot to expand the regions, since I never use them myself.
Sometimes I wonder if I might have better luck learning this stuff sober, but then I remember all the nuclear missile design work I did on bar napkins. That all worked out okay, so why change strategies now?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Within the *.designer.cs file there are several regions that are closed when you first open the file. The stuff you are after is in one of these regions.
Look for '+ Windows Form Designer generated code'. If you haven't changed the standard colour settings it will be greyed out. Click the '+' or right-click and select appropriately from the context menu.
If memory serves there is even a setting in Tools|Options to have them automatically expanded when you open the file.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
As far as I can work out, finalizers/Dispose methods are only used for unmanaged resources, correct?
Well I have this problem:
I have a class inherited from UserControl. The constructor creates a ToolStrip to be displayed on the control. When the control is no longer referenced it gets GC'd, and the ToolStrip should too.
However I noticed a memory leak with this and I found a thread on another forum explaining that a ToolStrip subscribes to the SystemEvents.UserPreferenceChanged event. This prevents the control from being GC'd since that event is referencing it. A way to fix this is to set the Visible property of the ToolStrip to false before the control has no references to it. This works.
But I want this to be done "automatically". So how do I write a "destructor" method that will set the Visible property when no references to the ToolStrip are left? I'm confused since this isn't really an unmanaged resource.
|
|
|
|
|
Hi,
yes, Dispose is typically used to clean up unmanaged resources, such as memory allocated by native code. And is normally not needed for dealing with end-of-life aspects of managed resources, as the GC will find and collect those itself. However, IMO nothing is keeping you from using the same Dispose method for hiding the ToolStrip.
Example: you probably know the using construct gets used to automatically Dispose of an object when the code block is exited. This is also used by stream I/O; StreamWriter implements a Dispose, so a using construct will call Dispose, which basically closes the stream.
using (StreamWriter sw = File.CreateText(path)) {
sw.WriteLine("Hello");
sw.WriteLine("And");
sw.WriteLine("Welcome");
}
is an example in MSDN. Flush, Close and Dispose are all invisble; using calls Dispose, Dispose closes, and closing implies flushing first.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
OK, so this topic is relevant to a lot I'm doing at the moment. You say that Dispose is typically used to clean up unmanaged resources. But I've been reading up and getting conflicting opinions on what to do with dispose.
Do you have any good articles / best practices for how to use dispose? Say I create a Linq DataContext for the lifetime of my object, do I call Dispose on my context in my own dispose method or is there a better technique there?
|
|
|
|
|
Hi All,
I'm trying to create a table in a windows program but was not able to find the control that would allow me to do so. I would like to create a table that looks like the HTML table. I have tried using List View and turned on the grid. I've noticed that it is not possible to control the number of desired table rows, table height, and grid line thickness using ListView with grid property set to true. I'm planning to pull information from a text file into this table and then print it out. This is for a windows application not a web application. Please point me in the right direction, thanks in advance for your help.
|
|
|
|
|
Have you looked at the DataGridView? I used two of them in CP Vanity[^].
If you like it, make sure you test a print before you commit; it may be tricky, I don't know for sure.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|