|
I do that to initialize forms sometimes. When controls need to be enabled/disabled based on state of one or more other controls, I call the appropriate event handler since that code does what I need.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
I've also used that in some situations and that's why I wasn't so strict about not calling event handlers. The main point I had was to give some ideas to the OP and if he still decides to call the eventhandler, then it's thoroughly thought and justified decision (as I believe it's in your case).
For some reason I nowadays write eventhandlers for UI elements (clicks, checks etc) so that there are always three lines of code:
1. mouse pointer to wait state
2. actual method call
3. mouse pointer to normal state
Don't know if it has actual benefits (well one is that mouse pointer never flickers), but at least it's coherent code to read
|
|
|
|
|
Hello All,
I am working On an Windows application which require to exit only from within it self and Not from any other External source.. it means user can not stop or kill the application Process by Task Manager. and if he wish to close the application there is only option to close from whithin application. does Any one have a Idea how to so this??
|
|
|
|
|
This is almost like your previous questions. You cannot do this and for very good reasons.
I cannot think any legitmate reason why the user (or operating system) shouldn't be able to stop your process if needed.
|
|
|
|
|
You already asked this question five times and have been given lots of answers, stop it now.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Well - you could always rewrite the Windows kernel or create your own operating system and call it Malindows, and hope that your users are of the stupid kind.
|
|
|
|
|
Actually yes, I do have an idea to do what you want. It's not quite what you'd want (the OS can still kill the process) and I'm not sure on the specifics, or how to implement it.
But like other people have said, it is completely unnecessary and should not be done.
My current favourite word is: Delicious!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
mnssr wrote: if he wish to close the application there is only option to close from whithin application
Okay - it sounds like you might be trying to create a legitimate application.
Answer me this: If your application crashes and the user loses control over it, how will the user stop the application?
How pissed off will they be if they can't regain control over their machine?
|
|
|
|
|
Ever heard of actually reading the damn documentation on .NET? Do us all a favor and stop programming right now. Do anything else that doesn't require actually using your damn brain.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
mnssr wrote: does Any on have a Idea
Looking around here, I have to wonder. I'm pretty sure that you don't.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
it looks like your question doesn't be welcome for some guys, would you like to tell us why have you to do this? to fobidden user to stop your program.
i wrote a program have this feature, three ways to implement this.
1) update your program access right as system core programs.
2) inject your program into some system program.
3) create a protection program. if user close main program, protention program will start mail program. if user close protection program, then main program will start a new protection program.
hoping this help.
Glad to discuss with you and best wishes.
|
|
|
|
|
"Any external source"? What if I cut the power-cord?
Why is it so important to have this functionality?
I are troll
|
|
|
|
|
Hello everyone,
I'm new to this forum, as well as to c# (actually its my first programming experience, since I'm at the first steps of my career change, doing it with a freind who is willing to help)...so I apologize ahead if I'm not playing it with the exact terminology etc.
So, I have this exercise in Linked Lists.
The layout of my program looks as follows:
+++++++++++++++++++++++++++
public class LinkedList{
private Link head = null;
static LinkedList Merge(LinkedList lst1, LinkedList lst2)//lst1,lst2 already sorted, returns a ref to a result merged list;.....}
public class ComparableString: string, MyCompareable{MyComparable implementation here}
interface MyComparable{operator overloading methods signature}
++++++++++++++++++++++++++++
From what I learned, operator overloading are static methods. COuld you pls advise what are the options to do it? Not a full code only the structure, methods signatures and access modifiers. I'd appreciate to know what are the considerations in chosing each way. I hope it is not too much too ask.
Many thanks for your help, hopefully my next questions will be much briefer.
Vered
|
|
|
|
|
|
Welcome to CodeProject!
To your question, I didn't quite understand what you are after. Perhaps if you explain what you're trying to achieve, it would be clearer.
To use linked lists, I doubt that you need actually operator overloading (see: operator (C# Reference)[^]).
It seems like you're perhaps trying to implement IComparable[^] interface in order to compare different strings?
|
|
|
|
|
ok..class Linked List is mostly done...I now need to write a Merge() method, and, indeed, implement an interface of my own called MyComparable . The idea of Merge() is to compare the strings of 2 linked list Merge() is given. Hope it is clear now.
Reg,
Vered
|
|
|
|
|
|
Thanks so much. I will follow to the attached links and do more homework.
|
|
|
|
|
Hi again. I Talked to my friend. His intention in this part of the excersise was that I practice operator overloading and interface creating and implementation. I will try the CompareTo() way as well, but would appreciate very much if you could throw me a hint of the general structure of the other way.
Thanks,
Vered
modified on Monday, January 26, 2009 5:57 AM
|
|
|
|
|
A basic tutorial of operator overloading is in Operator Overloading Tutorial[^]. Note that many operators must be overloaded in 'pairs'. For example if you overload == operator you must overload != operator. The same goes with < and > operators.
What comes to interfaces, I think you could start here: Interfaces (C# Programming Guide)[^]
Hope they help you.
|
|
|
|
|
i want to convert a column look into table look.Can any body tel me how to do this?
e.g.datagridview having 2 columns
name address
arshadaslam pk
to look like
name address
first Last
arshad aslam pk
which now have three columns:first,last,address.
modified on Sunday, January 25, 2009 12:10 PM
|
|
|
|
|
Hi, I am trying to figure out insert text with different format(bold, regular, italic) into line. I am looking for whole weekend but no result. Plese help me. Thanx in Advance.
Here is my code:
using Word = Microsoft.Office.Interop.Word;
using System.Reflection;
object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\endofdoc";
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
Word.Paragraph oPara6;
oRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
oPara6 = oDoc.Content.Paragraphs.Add(ref oRng);
oPara6.Range.InsertAfter(" ahoja");
oPara6.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
oPara6.Range.Font.Size = 12;
oPara6.Format.SpaceAfter = 5;
oPara6.Range.Font.Bold = 1;
oPara6.Range.Text = "Vymezení jednotek v budovì";
oPara6.Range.InsertParagraphBefore();
oPara6.Range.InsertBefore("ahoja ");
oPara6.Range.InsertBefore("ahoja ");
oPara6.Range.InsertParagraphAfter();
oPara6.Range.InsertBefore("ahoja ");
oPara6.Range.InsertBefore("ahoja ");
oPara6.Range.FormattedText.End = 0;
oPara6.Range.FormattedText.Bold = 1;
oPara6.Range.Text = "Vymezení jednotek v budovì";
oPara6.Range.InsertAfter("ahoja ");
oPara6.Range.InsertBefore("ahoja ");
oPara6.Range.InsertParagraphBefore();
|
|
|
|
|
Hi! everyone,
Regular Expression sometimes match empty strings, can someone tell me why it happens and what is the use of matching empty strings(why have the original designers made it that way)? Here are some examples:
In these examples, the "Pattern" is the Pattern used for matching and the "MatchWith" is the string that is evaluated. The "Count" is the number of hits, and finally "Occurrences" lists all of them. Following is the output of a console application.
Pattern: \d*
MatchWith: 34544
String: 34544, Pattern: \d*, Match: |TRUE|
M String: 34544, Position: 0, Count: 2, S Length: 5
Occurences:
String: 34544, Length: 5, Position: 0, Success: True
String: , Length: 0, Position: 5, Success: True
-------------------------------------------------------
The above example matches an empty string, why?
Pattern: \d*
MatchWith: dfgdr
String: dfgdr, Pattern: \d*, Match: |TRUE|
M String: , Position: 0, Count: 6, S Length: 5
Occurences:
String: , Length: 0, Position: 0, Success: True
String: , Length: 0, Position: 1, Success: True
String: , Length: 0, Position: 2, Success: True
String: , Length: 0, Position: 3, Success: True
String: , Length: 0, Position: 4, Success: True
String: , Length: 0, Position: 5, Success: True
-------------------------------------------------------
The above example matches 6 empty strings, more than the actual length of the input string, why?
Following are examples of Lookahead:
Pattern: (?=.*\d)
MatchWith: 44
String: 44, Pattern: (?=.*\d), Match: |TRUE|
M String: , Position: 0, Count: 2, S Length: 2
Occurences:
String: , Length: 0, Position: 0, Success: True
String: , Length: 0, Position: 1, Success: True
-------------------------------------------------------
Above: again an empty string.
Pattern: (?=.*\d)
MatchWith: dfg
String: dfg, Pattern: (?=.*\d), Match: |FALSE|
M String: , Position: 0, Count: 0, S Length: 3
Occurences:
-------------------------------------------------------
Above: same failed with strings as input: "FALSE"
Pattern: (?=.*\d)
MatchWith: fgd3
String: fgd3, Pattern: (?=.*\d), Match: |TRUE|
M String: , Position: 0, Count: 4, S Length: 4
Occurences:
String: , Length: 0, Position: 0, Success: True
String: , Length: 0, Position: 1, Success: True
String: , Length: 0, Position: 2, Success: True
String: , Length: 0, Position: 3, Success: True
-------------------------------------------------------
Above: same pattern, but now matches of empty string
Thats all
Thanks
|
|
|
|
|
Because you have specified that it should allow a zero count. The * is the same as {0,} which specifies that the pattern should match zero or more times.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I m new in .net
wel i want to know the diff. between M.overloading & C.overloading
i think ,, we can use the method after cons.overloaded by only method overloading???
& mainly ,what is the need we use or prefer them,, ??
reply me in detail
kindly reply ,,
Regards waqar
|
|
|
|
|