|
Currently C# does not support optional parameters. It is being considered for inclusion in .net 4.0[^]
It supports overloading, but that's different. If you are calling an overloaded method, then just leave out the other parameters and the appropriate overload will be called automatically.
I've never come across a CommandBar class in the .net framework. There's one in the office object model, but that's not written in .net.
Post some of your code so I can see what you are doing.
Simon
|
|
|
|
|
|
Your answer was unacceptable!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Dammit. Rejected again. When am I going to learn to give the answer the poster wants, and not the correct one.
[Thanks for the booster vote ]
Simon
|
|
|
|
|
Wait for .Net Framework 4.0
it is supported
WaelA
Senior Software Engineer
abu_wer@hotmail.com
|
|
|
|
|
Hi,
I use a DateTimePicker in my project.
In the valuechange event I wrote some code.
The problem is that when I click on < (previous month) or > (next month) buttons or change the year, this event will fire. I want this event only when the date is click not in change month or year.
How its possible, please help me.
thanks in advance.
Justin
vchvchbv
|
|
|
|
|
You can use CloseUp event. It is fired when drop-down calendar is closed.
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
Thank you
Justin Jose
|
|
|
|
|
hi
i have three page, in my page1 has search option if i did search then results shown in gridview in the page1. the grid has edit button, if i click the edit button, then the page2 is displayed all the relevent data with a update button. if i click the update button then the page3 is shown, in that page has link button to page2. again i came from page3 to page 2 and go to page3. and came to page2 now i want to go page1 without any loss in the page1 gridview.
please give ur idea.
thanks
with regards
b.balachandhar
modified on Friday, November 14, 2008 1:53 AM
|
|
|
|
|
You're looking for the ASP.NET forum.
|
|
|
|
|
Hi all,
I am working Windows application. I have a requirement of downloading the files from a website.
When the application is runnning (downloading files), if user shutdown the
the system i need to cancel that shutdown and i have to display message like "Downloading files is not completed.You want stop Downloading files, if yes Click on btn_ShutDown ,if not btn_CancelShutDown.
For that i used Form1_Closing Event.
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason.Equals(CloseReason.WindowsShutDown))
{
// I dont know the actual logic, but i tried the below one. But its not working
e.Cancel; // But its not working.
}
}
Please suggest me how to cancel the Shutdowning of system.
Thanks in advance.
|
|
|
|
|
|
Thanks for your replay.
I already tried the logic present in the link
http://www.dotnetspider.com/resources/4541-Cancel-shutdown-e-computer.aspx[^]
But it's not worked.
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason.Equals(CloseReason.WindowsShutDown))
{
Microsoft.VisualBasic.Interaction.Shell("shutdown -a", AppWinStyle.MinimizedFocus, false, -1);
MessageBox.Show("Shutdown process cancelled!");
}
}
|
|
|
|
|
It doesnt' work because you cannot start new .EXE's while a shutdown is in progress and -a only aborts a PENDING shutdown, one which hasn't happened yet, so you're code is getting notified too late.
This[^] is how you really should do it. But, you really shouldn't be doing this at all.
|
|
|
|
|
I dont know how to get the status of windows, if its shutting down, but u can use, i think, this code on if the user doesnt want to shutdown.
add this:
using System.Diagnostics;
// code for canceling the shutdown
Process.Start("shutdown -a");
// code for shutting down
Process.Start("shutdown -s");
//The process command is just like Start/Run
I hope somebody helps you with "if shutting down"
Regards,
Matjaž
Força Barça!
|
|
|
|
|
call "shutdown -a" after fetching the reason either using the System.Process namespace either using Microsoft.VisualBasic.Interaction.Shell to cancel the windows shutdown. Also if the user hits shutdown choosing to abort file download, run with one of the options specified above the following shell command: "shutdown -s" for shutdown or "shutdown -r" for restart or "shutdown -t [time_in_seconds] -[r or s] for a "timed" restart or shutdown.
Code? Yeah i love it fried together with a glass of wine.
|
|
|
|
|
Exactly. For more information on the shutdown function, you can go Start/Run and open "cmd" and then type "shutdown /?".
Força Barça!
|
|
|
|
|
Hi..all
I want to create an software using C# (Visual Studio 2005)
My app is expected to monitor the copy-paste file process that is doing by the current logged user.
I only want to get 2 main informations:
1. The address of the source file
2. The address of the destination file
For example, if the user copy file textX.txt from folder C:\Document to folder E:\Data , my application should catch : The source address as C:\Document\textX.txt and The destination address as E:\Data\textX.txt
I already used FileSystemWatcher, but it can catch the destionation address only. How can I get the source address as well?
Any solution would get my great appreciation.
Thanks..
|
|
|
|
|
You can't use the FileSystemWatcher to do this. There's no event you can use either. This is something that you have to do by intercepting the calls bouncing around the Shell and/or I/O subsystem. Don't ask me how to do it, it have no idea. But that's the only place you can do this.
|
|
|
|
|
Dave Kreskowiak wrote: something that you have to do by intercepting the calls bouncing around the Shell and/or I/O subsystem.
Oh boy, that sounds like a load of fun
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I for one have learned more in here than any book or school I have ever read or been to. I have MANY BOOKS.. Yes, this old man has two Masters degrees. Electronics and English (My language so I have cheated a bit). I had no money to do better!
I for one think you are ALL the greatest! Even the post I have downloaded that did not fit my needs at the time. I still learned something. Good AND bad.. Both helpful to my way of thinking.
I AM NOT a professional programmer or even try to make money doing it. I just code for FUN! AND ME!. I love to see what wokks in my programs and what does not. Both may be perfect code but not corect at what I am doing at the time.
I love to see if I can do better (as in most times make it less that what was posted)..
I thank you all for the knowledge..
|
|
|
|
|
Yeah! CP rules! Lets party.
Simon
|
|
|
|
|
Yay! A party!!! Will there be any bourbon?
j.t.
|
|
|
|
|
|
I have a class that when triggered downloads a file using the webclient class. The problem is my event AsyncCompletedEventHandler is never triggered when the file is finished downloading, never informing the user that the file is downloaded. Where did I go wrong?
public Download(string URL1, object send)
{
Sender = send;
Url = URL1;
WebClient client = new WebClient();
client.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCallback2);
string[] s;
s = Url.Split(new Char[] { '/' });
string l;
System.Uri Uri = new System.Uri(Url);
l = @System.IO.Directory.GetCurrentDirectory();
l = @l + @"\" + s[3];
client.DownloadFileAsync(Uri, l);
}
public void DownloadFileCallback2(object send, AsyncCompletedEventArgs e)
{
//some code to inform user to run file or not...
}
|
|
|
|