|
Try checking out the documentation for TreeView.Nodes.Add(string)[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have created a propertygrid and a dialog form in Windows Form.
How can I make my dialog form pop up when i click on the attribute of my PropertyGrid?
Can first give a reference site where i can find out the answer cause it is quite urgent.Preferably an executable program..
Deadline approaching... Please help...
Thank you
|
|
|
|
|
Searching about EditorAttribute .. you will find your solution.
And you might need this as well TypeConverterAttribute.
Hope this help
|
|
|
|
|
I have manage to make my PropertyGrid pop up Font form from the System.Windows.Drawing but no luck with my own defined form class, i try to make it pop up like the Font, intead it select all the Windows.Form properties inside my PropertyGrid.
Please help!!!
|
|
|
|
|
I am trying to create a timer that will pause the program for 1.5 seconds. I need something that pauses but does not stop the Thread.
In a nutshell, here is what I am doing. I have two cards that appear on the screen. I want them to stay there for 1.5 seconds and then re-draw back to a default value.
I have tried the Thread.Sleep but that pauses the entire program and prevents the one card from displaying at all (even though the sleep is called after the line to display the card).
Any help would be appreciated.
|
|
|
|
|
Monitor.Wait(new Timespan())
|
|
|
|
|
Can you be more specific. I can't get that to work either.
Here is the code I have tried using:
private void P1Flip_Click(object sender, System.EventArgs e)
{
GetCard(1);
Player1Card = P1Card.GetCardNum();
Invalidate();
P1CardPlayed = true;
P1Flip.Enabled = false;
if (P1CardPlayed && P2CardPlayed)
{
PlayGame();
if ((winner == 1) || (winner == 2))
{
Threading.Thread.Sleep(WaitTime);
Player1Card = 67;
Player2Card = 67;
UpdateCardsLeft();
P1CardPlayed = false;
P2CardPlayed = false;
P1Flip.Enabled = true;
P2Flip.Enabled = true;
}
else
{
ShowWarMessage();
P1War.Enabled = true;
P2War.Enabled = true;
P1CardPlayed = false;
P2CardPlayed = false;
}
}
}
My problem is even though the Threading.Thread.Sleep(WaitTime) is after the Invalidate() command, the screen is not re-drawing until after the WaitTime? This is driving me nuts.
|
|
|
|
|
Bob Bonser wrote:
My problem is even though the Threading.Thread.Sleep(WaitTime) is after the Invalidate() command, the screen is not re-drawing until after the WaitTime? This is driving me nuts.
Try throwing a Application.DoEvents(); in just before you put the thread to sleep. This will give the window the opportunity to respond to the WM_PAINT message it's about to receive.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Hi
i want to zip a file or folder at runtime . is there a command for running to zip a folder in windows ? ( i have win XP so i think must there is a command for this work )
Regards' Amir jalaly
|
|
|
|
|
Although XP has the ability to READ zip files and display them like they were directories, I don't beleive it has the ability to create them. There are a number of open source librarys like this one[^] that provide some zip creation support.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Rob Graham wrote:
I don't beleive it has the ability to create them
You might be happy to try...
Right click File or Folder.
Send To -> Compressed (zipped) Folder
|
|
|
|
|
That makes a compressed NTFS folder, not a zip file....
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Is this information incorrect then?
http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/UserTips/Miscellaneous/CompressedZippedversusCompressionFoldersinXP.html
The article says that MSFT has used code based on WinZip7.
|
|
|
|
|
My Bad! You appear to be correct.
so the answer to the original request is....?
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Wont work. All you need to do is create a new Text file on the Desktop or where ever you need in the file system, then rename it with a .ZIP extension. You can then drag and drop all the files you want into the new .ZIP.
I don't know how to get this to work in code though. For backward compatibility with Windows 2000/NT, you might want to try the #ziplib[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You're right... I was just responding to the notion that WinXP has no support for creating (actual) ZIP files.
|
|
|
|
|
Hello
How can I marshalling an array of structures from c# to an unamanaged c++ code?
Is is possible?
Thanks in advance.
|
|
|
|
|
Yes, it's possible. Check out this[^] little sample on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello I'm pretty new to C# and programming in general. Anyway I was playing with WMI and have some code that will query a local machine and display some basic info about the local machine to the command prompt.
I would like to redirect this to a a MSDE database, could anyone let me know how I do this?
This is the code I have:
//WMI.cs
//Extracts computer system information using WMI
using System;
using System.Management;
namespace WMI
{
///
/// Summary description for Class1.
///
class Class1
{
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
ManagementObjectSearcher query1 = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem") ;
ManagementObjectCollection queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine("Name : " + mo["name"].ToString());
Console.WriteLine("Version : " + mo["version"].ToString());
Console.WriteLine("Manufacturer : " + mo["Manufacturer"].ToString());
Console.WriteLine("Computer Name : " +mo["csname"].ToString());
Console.WriteLine("Windows Directory : " + mo["WindowsDirectory"].ToString());
}
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem") ;
queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine("Manufacturer : " + mo["manufacturer"].ToString());
Console.WriteLine("Model : " + mo["model"].ToString());
Console.WriteLine(mo["systemtype"].ToString());
Console.WriteLine("Total Physical Memory : " + mo["totalphysicalmemory"].ToString());
}
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_processor") ;
queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine(mo["caption"].ToString());
}
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_bios") ;
queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine(mo["version"].ToString());
}
query1 = new ManagementObjectSearcher("SELECT * FROM Win32_timezone") ;
queryCollection1 = query1.Get();
foreach( ManagementObject mo in queryCollection1 )
{
Console.WriteLine(mo["caption"].ToString());
}
}
}
}
Cheers
|
|
|
|
|
There is one more thing I don't know how to do...
This is a picture of my program
[IMG]http://img225.exs.cx/img225/9963/clipboard019vo.jpg[/IMG]
I want to add some numbers to these text fields (it would be optimal if a user can write just number or text,depends on my choice when creating text boxes). And when all fields are written user have to press right button bellow these text fields.
Now I would like that when user press that button, values from these text field replace values in existing data.txt file in some directory (for example C://prgram files/...) and program runs (for example blblbl.exe - fortran program). How can I do that?Also there is posibility that values in text box create new text docuent called data.txt in particular directory. That would be also grat!
Stefan tried to help me, but I am plain beginner and I didn't understand him much.
|
|
|
|
|
Hi
I have written a Windows Service in C# to act as a backup utility when a user changes a file. It copies a set of selected files when it starts and then uses the FileSystemWatcher, but it will not copy a file if it is busy. Also the Service calls Reg.exe to copy HKLM\SAM, SECURITY, SOFTWARE and SYSTEM. But again it will not copy SECURITY because it is busy.
Is there a way round this? Any help would be appreciated. Thanks.
P.S This is my first ever project in C# and I have had to teach myself.
Kieran Wareing
|
|
|
|
|
You can't copy/export the Security key unless your service is running under the Local System account. Any other account will not have the rights to open that key.
Copying an open file depends on how the other application opened it. If it was opened with DenyShareRead, and/or your application is opening it for exclusive access, then you won't be able to open the file to copy it. There is no way around this...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave
Back to the drawing board I think....!
Kieran
|
|
|
|
|
Hi all,
I am doing a project in C#. its about creating and capturing packets. I have finished the part of capturing. I am using winpcap dll for capturing and libnetNT for packet creation. Creating and injecting of the packet onto the network is also complete.
i want to provide an interface to the user so that he can create a particular packet manually. i.e. enter the IP addresses and all. what can I use to take the inputs from the user? I dont want to use simple text boxex.
For displaying the packets I am using listview.
bye
dfgdfgdfgdfg
|
|
|
|