Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Saqib Mehmood

@Saqib Mehmood
About
Posts
23
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • is a File Read Only.
    S Saqib Mehmood

    How can I check whether the file is ReadOnly or not.

    Saqib

    C# question

  • To focus or not to focus
    S Saqib Mehmood

    Use Focus instead of select button1.Focus()

    Saqib

    C# graphics help question

  • Shell icons
    S Saqib Mehmood

    for getting file icons you need to use shell APIs. you can use the following snippet.

    // define a struct for getting info from shell

    [StructLayout(LayoutKind.Sequential)]
    public struct SHFILEINFO
    {
    public IntPtr hIcon;
    public IntPtr iIcon;
    public uint dwAttributes;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
    public string szDisplayName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
    public string szTypeName;
    };

    // define this class for invoking shell api to get file information
    class Win32
    {
    public const uint SHGFI_ICON = 0x100;
    public const uint SHGFI_LARGEICON = 0x0; // 'Large icon
    public const uint SHGFI_SMALLICON = 0x1; // 'Small icon

    \[DllImport("shell32.dll")\]
    public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
    

    }

    // write the following code where you want to get the selected file icon.

    IntPtr hImgSmall; //the handle to the system image list
    string fName = "c:\\getfileicon.cs"; // 'the file name to get icon from
    SHFILEINFO shinfo = new SHFILEINFO();

    //Use this to get the small Icon
    hImgSmall = Win32.SHGetFileInfo(fName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON |Win32.SHGFI_SMALLICON);

    /*
    //Use this to get the small Icon
    hImgLarge = Win32.SHGetFileInfo(fName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON |Win32.SHGFI_LARGEICON);
    */

    //The icon is returned in the hIcon member of the shinfo struct
    System.Drawing.Icon myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);

    // do whatever with this icon. i.e I am adding it to an Image List.
    imageList1.Images.Add(myIcon);

    I think this code would be helpful.

    Saqib

    C# csharp linux tutorial question

  • DataGridView New Row
    S Saqib Mehmood

    just set AllowUserToAddRows property to false.

    Saqib

    C#

  • DataGridView New Row
    S Saqib Mehmood

    I have already done this. My problem is not making ReadOnly but it is rather I dont want to show NewRow that appear with * sign.

    Saqib

    C#

  • DataGridView New Row
    S Saqib Mehmood

    In DataGridView control New row is always present. Is there any way If I dont want to display this new row because the data I am presenting in it to user is readonly.

    Saqib

    C#

  • create a loadable dll from vs 2005 environment (instead of by using csc)
    S Saqib Mehmood

    You should use ClassLibrary type project to create dll in VS.

    Saqib

    C# csharp visual-studio help tutorial question

  • OOP Book
    S Saqib Mehmood

    I recommend you Wrox Professional C#.

    Saqib

    C# csharp question learning

  • copy and paste text
    S Saqib Mehmood

    you can get the focus for TextBox try this code in menu click event.;) if (this.textBox1.Focused) { // .... } else if (this.textBox2.Focused) { // .... }

    Saqib

    C# performance help question

  • copy and paste text
    S Saqib Mehmood

    Hi, I think in the mainMenu click event you can just check the focus control and then if the focus control is a TextBox then you can get the selected text from it to use in copy operation.

    Saqib

    C# performance help question

  • plz help!
    S Saqib Mehmood

    Yes you can, add a new column to the datasource (DataTable??) which you are creating manually and fill data in that newly added column from datatable filled from database. Saqib

    C# database help question

  • How to view a Flash file in C#
    S Saqib Mehmood

    If you want to read the flash file yourself then you must have to understand the file format, read from file and also display and animate graphics yourself, which I think would be difficult. If you still want to continue then I would say best of Luck, and do share what you do. Saqib

    C# csharp adobe help tutorial

  • Start a Windows application from an ASP page
    S Saqib Mehmood

    You need to look in to System.Diagnostics Namespace class Process. using this you can start a process by supplying command line arguments. The issue that you face is that you would not be able to lunch Process from web application, for this read this from Microsoft Help hope you find it an easy doing. good luck ;) Saqib -- modified at 0:33 Wednesday 24th May, 2006

    ASP.NET csharp database winforms

  • How to view a Flash file in C#
    S Saqib Mehmood

    You need to use Flash ActiveX to view flash files in C#. check here Saqib

    C# csharp adobe help tutorial

  • How can i use another application outside my program?
    S Saqib Mehmood

    you can start an external process by using Process.Start from System.Diagnostics namespace. to rename a file you can use File.Move in which you need to specify source and target. Saqib

    C# question help tutorial

  • how run commend DOS in aps.net
    S Saqib Mehmood

    solution is here Saqib

    C# question csharp asp-net com

  • How to make copy of db
    S Saqib Mehmood

    get backup of existing database, create new database and restore that backup to new created database, this would now contain all things in it. Saqib

    Database database question tutorial

  • how to embedd or bind any file to my app at runtime ?
    S Saqib Mehmood

    With binding what do you exactly mean, like what would you take or give to that bound file. Saqib

    C# tutorial database question

  • How to make copy of db
    S Saqib Mehmood

    Create a database with new name and export all data of existing database to new one. Saqib

    Database database question tutorial

  • Data Base problem
    S Saqib Mehmood

    check the following article. http://www.codeproject.com/cs/database/sqldawithoutsqlcb.asp hope this would solve the problem. Saqib

    C# help tutorial question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups