|
These warnings are telling you that because you have overriden the == and != operator there are 2 further methods inherited from Object that you should override.
Equals - returns true if the object passed into the obj parameter should be considered equal the current object
GetHashCode - returns an int used in hashing algorithms. Objects that return true from Equals should return the same HashCode from this method.
You can override these methods in your object by using the override keyword.
|
|
|
|
|
Are you sure that they are errors, not warnings?
The compiler says that you have created a class that will behave erratically. The Equals method should give the same result as the equality operator, so if you override one of them, you should override the other. If you compare the object to something, it will first look for a specific equality operator for the data type, and if none exists, it uses the Equals method. If you have overridden only the equality operator but not the Equals method, the comparison will work differently depending on what you compare it to.
The GetHashCode method is used among other things when you put an object in certain collections. If the GetHashCode methods isn't based on the same data as the equality operator, the object won't work correctly in the collection.
---
b { font-weight: normal; }
|
|
|
|
|
It must be a warning !
simply ignore it
or add Equals, GetHash function
|
|
|
|
|
I´ve made a desktop application in C# (.NET 1.1) and now I would like it to run in a local intranet. I know that I can change the .NET configuration on each client and give the application FULL_TRUST permission on the machine ... but isn´t there an easier way ??
Each assembly in the application is strong named, and I seem to remember that this should make it possible to have .NET prompt each user for FULL_TRUST permission when the application is initially launch. This would remove the need for changing the .NET configuration on each machine and make my life much easier
Is this possible or is my memory playing me for a fool
Regards
Bjarne
|
|
|
|
|
hi.. in fom1 i have some controls ( for example datagrid1,textbox1,2,3 ...,button1,... )
and i want set properties of datagrid.forecolor (for example) from form2 ( form2 = setting window for example )
how to do that ?
|
|
|
|
|
The controls are not public so you can't set the properties from another form. You can either set the controls to public (not good) or code own properties or functions to control the properties of the controls (better).
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
hi thanks for your reply but i tested this solution and don't gave result
i believe this is may but how ?
|
|
|
|
|
Is an error thrown? Perhaps you can quote this part of your code. It's hard to guess the mistake, when you don't know what was done?!
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
how can i open a online web page through desktop application by clicking a button.
Raheel Iqbal
|
|
|
|
|
You don't have to ask the same question more than one time within an hour. Other wait some hours, a whole day or more before the question is answered. And they don't start you new thread every thirty minutes.
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
Well I started a test and tried:
System.Diagnostics.Process.Start("http://www.google.de/");
This should start your Browser with the Google Homepage.
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
How can i hide my form when the user clicks the Close (X) button? What should i write and under which event?
|
|
|
|
|
on form close event you have to write,
this.hide();
Raheel Iqbal
|
|
|
|
|
You should catch the FormClosing event (under Net 1.1 it's just calledc closing event I think):
<br />
private void FormTest_FormClosing(object sender, FormClosingEventArgs e) {<br />
e.Cancel = true;<br />
this.Hide();<br />
}<br />
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
I've tried using your code but I'm a small problem - I'm using a notify icon class in my project and when i click the close button, my aplication exits instead of hiding.
|
|
|
|
|
Well I don't know the nofiyicon class but I don't know if this changes somtehing. I tested my code again and my form isn't closed. I put a timer on the form and I'm able to show this form again.
What does the NotifyIcon Class on your Form?
Greetings,
Ingo
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
what an idiot I am. I totally forgot to add the e.cancel = true; My bad.
|
|
|
|
|
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
if i set e.cancel = true and this.hide() then the form will not closing..and still it is visible.. i wrote the code in formClosing Event.. Any ideas..
Regards,
Saravanna
|
|
|
|
|
how can i redirect to a web page by clicking a button of desktop application, can any one help me what method should i follow.
Raheel Iqbal
|
|
|
|
|
I have made a button on my main form and I want it to show a ContextMenu when the button is clicked, not when you Right click it. Like start button on windows
In the end we're all just the same
|
|
|
|
|
Catch the MouseDown / MouseUp events there you can call a context menu even when the left Mousebutton is pressed.
<br />
private void btnMenu_MouseDown(object sender, MouseEventArgs e) {<br />
btnCreateReport.ContextMenuStrip = cmnStartMenu;<br />
this.btnCreateReport.ContextMenuStrip.Show(this.Location.X + btnMenu.Location.X + e.X, this.Location.Y + btnMenu.Location.Y + e.Y);<br />
} <br />
Where cmnStartMenu is a ContextMenuStrip
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
Thanks.
Now I would like this menu to be twice the size when it appears. How would you do this?
Also how would you add a sound to this menu so when you click the button, a sound is played?
In the end we're all just the same
-- modified at 8:10 Wednesday 8th February, 2006
|
|
|
|
|
|
I have a problem with the code:
private void btnMenu_MouseDown(object sender, MouseEventArgs e) {
btnCreateReport.ContextMenuStrip = cmnStartMenu;
this.btnCreateReport.ContextMenuStrip.Show(this.Location.X + btnMenu.Location.X + e.X, this.Location.Y + btnMenu.Location.Y + e.Y);
}
AN error message says:
Cannot find this.Location on Information_Device form and its the same with btnCreateReport what should I do?
In the end we're all just the same
|
|
|
|