Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: passing data between forms Pin
mamoony10-Sep-12 10:06
mamoony10-Sep-12 10:06 
QuestionDelete From XML File Pin
Kevin Marois31-Aug-12 8:47
professionalKevin Marois31-Aug-12 8:47 
AnswerRe: Delete From XML File Pin
PIEBALDconsult31-Aug-12 9:40
mvePIEBALDconsult31-Aug-12 9:40 
GeneralRe: Delete From XML File Pin
Kevin Marois31-Aug-12 9:52
professionalKevin Marois31-Aug-12 9:52 
GeneralRe: Delete From XML File Pin
PIEBALDconsult31-Aug-12 11:20
mvePIEBALDconsult31-Aug-12 11:20 
GeneralRe: Delete From XML File Pin
AmitGajjar31-Aug-12 23:27
professionalAmitGajjar31-Aug-12 23:27 
QuestionTo show the properties page of a file and navigate to a tab Pin
John T.Emmatty31-Aug-12 4:03
John T.Emmatty31-Aug-12 4:03 
AnswerRe: To show the properties page of a file and navigate to a tab Pin
Shameel31-Aug-12 4:56
professionalShameel31-Aug-12 4:56 
Use the ShellExecuteEx Win32 API to achieve this.
C#
using System.Runtime.InteropServices;

[DllImport("shell32.dll", CharSet = CharSet.Auto)]
static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct SHELLEXECUTEINFO
{
    public int cbSize;
    public uint fMask;
    public IntPtr hwnd;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpVerb;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpFile;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpParameters;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpDirectory;
    public int nShow;
    public IntPtr hInstApp;
    public IntPtr lpIDList;
    [MarshalAs(UnmanagedType.LPTStr)]
    public string lpClass;
    public IntPtr hkeyClass;
    public uint dwHotKey;
    public IntPtr hIcon;
    public IntPtr hProcess;
}

private const int SW_SHOW = 5;
private const uint SEE_MASK_INVOKEIDLIST = 12;
public bool ShowFilePropertiesDialog(string fileName)
{
    SHELLEXECUTEINFO info = new SHELLEXECUTEINFO();
    info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info);
    info.lpFile = fileName;
    info.lpVerb = "properties";
    info.fMask = SEE_MASK_INVOKEIDLIST;
    info.nShow = SW_SHOW;
    return ShellExecuteEx(ref info);
}


And then use the method like this:

C#
ShowFilePropertiesDialog(@"C:\hello.txt");

GeneralRe: To show the properties page of a file and navigate to a tab Pin
John T.Emmatty31-Aug-12 5:08
John T.Emmatty31-Aug-12 5:08 
AnswerRe: To show the properties page of a file and navigate to a tab Pin
Shameel31-Aug-12 5:11
professionalShameel31-Aug-12 5:11 
Question.Net C# GUI dll will use in VB6 (Not user control) Pin
mamoony31-Aug-12 3:52
mamoony31-Aug-12 3:52 
AnswerRe: .Net C# GUI dll will use in VB6 (Not user control) Pin
Shameel31-Aug-12 4:47
professionalShameel31-Aug-12 4:47 
GeneralRe: .Net C# GUI dll will use in VB6 (Not user control) Pin
mamoony31-Aug-12 7:59
mamoony31-Aug-12 7:59 
Questionhow to get difference between 2 dates in years:months format? Pin
Anurag Sinha V30-Aug-12 21:56
Anurag Sinha V30-Aug-12 21:56 
AnswerRe: how to get difference between 2 dates in years:months format? Pin
Richard MacCutchan30-Aug-12 22:36
mveRichard MacCutchan30-Aug-12 22:36 
GeneralRe: how to get difference between 2 dates in years:months format? Pin
Anurag Sinha V30-Aug-12 23:29
Anurag Sinha V30-Aug-12 23:29 
GeneralRe: how to get difference between 2 dates in years:months format? Pin
Richard MacCutchan31-Aug-12 4:11
mveRichard MacCutchan31-Aug-12 4:11 
AnswerRe: how to get difference between 2 dates in years:months format? Pin
PIEBALDconsult31-Aug-12 3:17
mvePIEBALDconsult31-Aug-12 3:17 
GeneralRe: how to get difference between 2 dates in years:months format? Pin
Marcus_231-Aug-12 3:49
Marcus_231-Aug-12 3:49 
AnswerRe: how to get difference between 2 dates in years:months format? Pin
Ravi Bhavnani31-Aug-12 7:21
professionalRavi Bhavnani31-Aug-12 7:21 
GeneralRe: how to get difference between 2 dates in years:months format? Pin
Anurag Sinha V31-Aug-12 18:08
Anurag Sinha V31-Aug-12 18:08 
AnswerRe: how to get difference between 2 dates in years:months format? Pin
timeArrowI2-Sep-12 21:59
timeArrowI2-Sep-12 21:59 
GeneralRe: how to get difference between 2 dates in years:months format? Pin
Anurag Sinha V3-Sep-12 1:00
Anurag Sinha V3-Sep-12 1:00 
QuestionTrackbar's Scroll Box Position Pin
varunpandeyengg30-Aug-12 20:57
varunpandeyengg30-Aug-12 20:57 
AnswerRe: Trackbar's Scroll Box Position Pin
OriginalGriff30-Aug-12 21:11
mveOriginalGriff30-Aug-12 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.