|
Thanks Tom,
The link your provided is very helpful. After reading it, I am confused about what means "This would be useful, because the Service Control Manager (SCM) Microsoft Management Console snap-in does not support custom commands." -- custom commands means? Could you show me an example please?
regards,
George
|
|
|
|
|
Hi friends
How to use a common source class (.cs) file in different project files without copying into project's folder.
thanks in advance
-RisKhan-
|
|
|
|
|
What a bout compling the class to DLL
and the add it to the ref
Have Fun
Never forget it
|
|
|
|
|
Hello,
You have to think Classes not file.
The best solution is to create a Class libraby project (DLL) that contains your classes
Then if you want to use it, you reference it in your current project.
That's it !
|
|
|
|
|
i think above solutions are good
thanks
-RisKhan-
|
|
|
|
|
Add the file as a 'Link', you get this by clicking the little down arrow on the 'Add' button.
|
|
|
|
|
In my Application i want to Hide Cursor. i want to disable right click,..left click menu strip all.
I try with
Cursor.Show();
ShowCursor(1);
[DllImport("user32")]
public static extern int ShowCursor(int bShow);
but it is not success.Also i need to enable the mouse in one page. i have an internet page also in my application i want to enable the cursor in that page.
So what is the best solution for my application?
|
|
|
|
|
Cursor.Hide();
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
yes Cursor.Hide(); is correct.
Only thing is we need to balance Cursor.Hide() and Cursor.Show()
we can do it by from win API also that do the same,..
ShowCursor(0) and ShowCursor(1)
[DllImport("user32")]
public static extern int ShowCursor(int bShow);
|
|
|
|
|
Hi,
I'm broadcasting a meesage to a port and wait to receive response from all the devices that are connecting to this port.
So I put the receiveFrom() in a while loop. My problem is when there are no more device the application stuck on the receiveFrom (as it doesn't receive...).
I think that I should set a timeout but how to do that?
Thanks,
|
|
|
|
|
Aren't you running ReceiveFrom() on a separate thread?
|
|
|
|
|
|
You can run it on a separate thread. So that the other application areas won't be affected and your application won't get stuck when there no messages to receive.
|
|
|
|
|
Thanks but this is not what I asked for.
Anyway I have found a way to do this.
Thank you.
|
|
|
|
|
Hi All,
How can i express this statement in C# code:
ZipCode is within 1000—1999
the data type of ZipCode is string and i can't change it to int.
if ((ZipCode >= 1000) && (ZipCode <= 1999))
but appraently it wasn't working. and i also did this:
if ((int)(ZipCode >= 1000) && (ZipCode <= 1999))
but it wasn't working either.
Thanks
|
|
|
|
|
Try this:
int code = int.Parse(ZipCode);<br />
if((code >= 1000) && (code <= 1999))<br />
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
|
Since you have it in string, using int.Parse may result in error when you have other than numbers in the string. So always use int.TryParse
bool IsInRange(string zipCode){
int code;
return (int.TryParse(zipCode, out code) && code >= 1000 && code <= 1999);
}
|
|
|
|
|
if ((Convert.ToInt32(ZipCode) >= 1000) && (Convert.ToInt32(ZipCode) <= 1999))
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Why not simply compare them as strings?
if (ZipCode >= "1000" && ZipCode <= "1999")
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
is there any source-code link to capture youtube videos?
Thanx in advance
(Riaz)
|
|
|
|
|
|
I have a list box that I am populating from a file. My file has a reference ID and I want to display text in the list box and associate it with the ID. This is easy when I display the ID in the list box but I want to hide it without just change the text color to match the text box. Any help would be great.
|
|
|
|
|
Your question is not clear. Please explain it more.
|
|
|
|
|
It's not very clear what you want to do.
If you want to add all items but have no text for items that match a particular ID then you have two options. Both require overriding the ToString method of the objects you are adding to return string.Empty for the ones you want empty.
You can then either add the object itself to the listbox (handy cause you can cast back to the object itself later)
or
When you add the items, call the ToString method and use the ID property to set the Tag.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|