|
bool success=double.TryParse(myString, out myDouble)
|
|
|
|
|
you know that, I know that; however I'm not in the spoon feeding business,
I am plugging documentation here.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Very thanks!!!!!!!!!!!
It works very good
<br />
args = Environment.GetCommandLineArgs();<br />
double.TryParse(args[1], out d);<br />
this.Opacity = d;<br />
Now I will make that when the argument in the commandline don't exist, set a default Opacity 1.0.
I will try.
Thanks, Bye
|
|
|
|
|
Hello Friend!
I've built a windows application.
now I want to show any gif image while system is busy to save data in data base. after completing save operation the image will be invisible. again it will be visible during saving data.
How can I do this?
Please, help me.
Thanks!!!!!!!!!!
|
|
|
|
|
1. show image
2. use a delegate to the save method, and call begininvoke
3. in the callback, remove the image
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
Thanks!
Can u give me any small code example explaining delegate
|
|
|
|
|
abc.aspx this is my first page . and xyz.aspx is open if click a button .
if close xyz.aspx then refresh the abc.aspx.
Regard
Bhagwan Chaubey
hi this is bhagwan chaubey
|
|
|
|
|
Is xyz.aspx a popup window?
|
|
|
|
|
chaubeyb wrote: abc.aspx this is my first page . and xyz.aspx is open if click a button .
C# forums this is. If close, then go to correct forum and post question.
|
|
|
|
|
what you want to know ..explain
|
|
|
|
|
Hi,
I have read in 1 book that the STATIC function Object.Equals() check the object values and Object.ReferenceEquals() check their references.
For Ex- Suppose i have a user defined class - Person
Person p1 = new Person( 1,"ABC");
Persion p2 = new Person( 1,"ABC");
Object.Equals( p1, p2 ) -> returns true. // compares the state
Object.ReferenceEquals( p1,p2) -> returns false.// compares the reference.
The output should be like this as specified in that book. But am not getting like this. We cant overide static functions too. Any Idea? It would of great help.
Regards
|
|
|
|
|
|
You'll have to override the protected method Equals inherited from Object.
This flavor is my own personal favorite, note the use of the private Equals.
. I also like overloading the == operator.
namespace PersonTest {
class Program {
static void Main(string[] args) {
Person p1 = new Person { Member = "ABC", OtherMember = 1 };
Person p2 = new Person { Member = "ABC", OtherMember = 1 };
Console.WriteLine(Object.Equals(p1, p2).ToString());
Console.WriteLine(Object.ReferenceEquals(p1, p2).ToString());
Console.ReadLine();
}
}
public class Person {
public String Member { get; set; }
public Int32 OtherMember { get; set; }
public override Boolean Equals(Object obj) {
return obj is Person ? Equals(obj as Person) : false;
}
private Boolean Equals(Person obj) {
if (Object.ReferenceEquals(this, obj)) return true;
if ((obj == null) || (this == null)) return false;
return obj.Member == this.Member && obj.OtherMember == this.OtherMember;
}
public override int GetHashCode() {
return base.GetHashCode();
}
}
}
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Hi,
If we are overriding the protected method Equals(), then whats the difference between the usage of virtual function Equals() and static function Equals defined in the Object class.
|
|
|
|
|
The static method Equals(object.object) uses the virtual method Equals(object). You just have to override the Equals(object) method in your Person class.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hello,
I have, on a PC, two Network Adapters.
I need to test the quality of these interfaces, with a cross link.
I have written a small program in C# with a client socket and a server socket.
But I want to be sure that exchange is going on the cable, and NOT inside the network layers of the PC.
So I want to bind the client socket and the server socket each to one of the interfaces.
The function I want to use is in the following code :
Socket xPortSend;
//...
byte[] AdapterId = ????
int iRet = xPortSend.IOControl( IOControlCode.BindToInterface, AdapterId, null );
1) I don't know how to find the Adapter Id of each network interface ?
2) Which is the exact synthax to use with the function "IOControl" ?
Some samples on this call will be very helpfull ?
Best regards.
|
|
|
|
|
hello ,
is it possible to create a c# application that detect if the PC is shuting down
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
what for you want that application ? if PC shuts down ,application also shuts down
Koushik
|
|
|
|
|
ellllllllie wrote: hello ,
is it possible to create a c# application that detect if the PC is shuting down
Yes. There I've answered your question.
|
|
|
|
|
How can add a property to a existing .NET control. For eg: Add a property "AllowNumbers" to textbox control.
Thanks
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
derive a new class from it and add your property
public class MyTextBox : TextBox
{
public MyTextBox() : base()
{
}
private bool allowNumbers = false;
public bool AllowNumbers
{
get{ return this.allowNumbers; }
set{ this.allowNumbers = value; }
}
}
|
|
|
|
|
Thanks a lot.
I am facing one more issue.
I have created a user control, but when I add it to the form from the toolbox I get following code in the designer file:
this.usercontrol1 = new usercontrol.usercontrol();
instead of
this.usercontrol1 = new usercontrol();
This is causing build errors.
Any help with this ?
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
Put your control in the same namespace...
|
|
|
|
|
The form and the user control share the same namespace
Until you realize this message has nothing to say, its too late to stop reading
|
|
|
|
|
What kind of error ?
The compiler returns an error message, if error comes.
|
|
|
|