|
I am trying to retrieve the all the cells selected by user in the worksheet of Excel using C#. Can anyone help ?
|
|
|
|
|
Varad_Rajan wrote: I am trying to retrieve the all the cells selected by user in the worksheet of Excel using C#.
Why dont you just ask the user? Seriously, without giving us even a hint of what you are doing, will not get you an answer.
|
|
|
|
|
I want to detect if a key is held down during the start up of my program, i.e. in
static void Main()
Is this possible to achieve? I want to make a safe mode that will be entered if the user holds down the shift key when starting the program.
|
|
|
|
|
|
One way I can think of is to add a reference to System.Windows.Forms if you don't have it already and use the following:
static void Main(string[] args)
{
Keys modifiers = Control.ModifierKeys;
Console.WriteLine(modifiers);
}
The modifiers enumeration will have the keys held down (only works for the modifier keys, i.e. Control , Shift , Alt etc).
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Thanks! This works like a charm!
|
|
|
|
|
Hello everyone,
Is Concole.WriteLine and other Console write methods, like Console.Write thread safe? I can not find any related information from MSDN about the thread safety of this method.
thanks in advance,
George
|
|
|
|
|
George_George wrote: I can not find any related information from MSDN about the thread safety of this method.
Not directly, but it can be worked out from the documentation.
Console.WriteLine is a wrapper for Console.Out.WriteLine. Console.Out is an instance of a TextReader, and in the documentation for TextReader it says: "Thread Safety Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe."
|
|
|
|
|
So great, Colin!
regards,
George
|
|
|
|
|
|
Thanks Dave,
Your reply is very clear.
regards,
George
|
|
|
|
|
Hi All
I am using ICSharpCode.SharpZipLib.FastZip to unzip files we receive over the internet in C#.NET2. The problem I am having is that some of the zipped files we receive contains folders with the files we want in those folders. What I need is for it to unzip the files in the zipped folder directly to the 'target directory'.
I.e.
C:\zippedfiles.zip //Contains - "folder\zippedfile.txt"
//When unzipping it, I need it to be
C:\zippedfile.txt
//NOT
C:\folder\zippedfile.txt
That's it. Any help would be great, thanks in advance.
Kiefie
The man with a plan...now where'd that plan go?
|
|
|
|
|
Hello i am working with a chat in c# and there´s one thing left to do, a list of members who are in the chat, in a listbox. tried for hours but i am not comming anywhere so now i am asking for help.. so please can some one help me //Bobbziz
Waddatah
|
|
|
|
|
If you are using a client server approach, you would probably be best off if you made a function to retrieve a list of the users from the server.
|
|
|
|
|
Hey i trying to make a application thats run on background and write to a file how long user was running a application
Ex.
if user click on word then write to a file user clict on word time: 11:01 or somthing like that.
and if user clickt on internet explorer then write to file user clickt on internet explorer time: 11-03.
i hope you can help me.
Sorry my english,
|
|
|
|
|
|
thanks very much dave.. i was wery big help.
but how shut i get the application name which user has clict on.
thanks very mutch
|
|
|
|
|
Not sure - I just came accross that article the other day when searching for info for someone else!
This one[^] captures the App name so you should be able to figure it out from the source.
Don't forget to use the CP search function - that's how I found them
Dave
|
|
|
|
|
I was creating my tray icon for a console application using NotifyIcon Class adn it is working fine (it creates the icon)
However it dosent seem to run the event handlers (click events) on the icon..
Please guide me..
Here is my simple test program which dosent run the mouse events..
class Program
{
static void Main(string[] args)
{
Program p = new Program();
p.MyMethod();
}
void MyMethod()
{
NotifyIcon tray = new NotifyIcon();
tray.Icon = new Icon("MyIcon.ico");
tray.Visible = true;
tray.MouseClick += new MouseEventHandler(tray_MouseClick);
tray.Click += new EventHandler(tray_Click);
tray.DoubleClick += new EventHandler(tray_DoubleClick);
Console.Read();
}
public void tray_MouseClick(object sender, MouseEventArgs e)
{
Process.Start(@"C:\Windows\Notepad");
Console.WriteLine("Hello World!");
}
public void tray_Click(object sender, EventArgs e)
{
Console.WriteLine("Hello World!");
}
public void tray_DoubleClick(object sender, EventArgs e)
{
Console.WriteLine("Hello World!");
}
}
|
|
|
|
|
Where is your Application.Run ?
|
|
|
|
|
leppie wrote: Where is your Application.Run?
This is just a test to see whether on clicking the icon, the "Hello World" is printed to the console..
This is not a forms application, this is a console application.
I put a breakpoint on the code in the tray_MouseClick, trayClick, and tray_DoubleClick and it dosent hit the break points..
|
|
|
|
|
ptr2void wrote: This is not a forms application, this is a console application.
I know that, but how the hell is a Winform control suppose to respond if your app does not have a friggen message loop????
Thats why you need Application.Run . It will not work any other way.
|
|
|
|
|
tray.Click += new System.EventHandler(this.notifyIcon1_Click);
tray.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseClick);
tray.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
|
|
|
|
|
Abhijit Jana wrote: tray.Click += new System.EventHandler(this.notifyIcon1_Click); tray.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseClick); tray.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
hi, thanks for the answer, but it still dosent seem to work..
Here is my edited code, but still of no use..
static void Main(string[] args)
{
Program p = new Program();
p.MyMethod();
Console.Read();
}
void MyMethod()
{
NotifyIcon tray = new NotifyIcon();
tray.Icon = new Icon("Mcafee.ico");
tray.Visible = true;
tray.MouseClick += new System.Windows.Forms.MouseEventHandler(this.tray_MouseClick);
tray.Click += new EventHandler(this.tray_Click);
tray.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.tray_DoubleClick);
}
public void tray_MouseClick(object sender, MouseEventArgs e)
{
Process.Start(@"C:\Windows\Notepad");
Console.WriteLine("Hello World!");
}
public void tray_Click(object sender, EventArgs e)
{
MessageBox.Show("Hi");
}
public void tray_DoubleClick(object sender, EventArgs e)
{
Console.WriteLine("Hello World!");
}
|
|
|
|
|
are you getting any error ?
|
|
|
|