How can I check whether the file is ReadOnly or not.
Saqib
How can I check whether the file is ReadOnly or not.
Saqib
Use Focus instead of select button1.Focus()
Saqib
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
just set AllowUserToAddRows property to false.
Saqib
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
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
You should use ClassLibrary type project to create dll in VS.
Saqib
I recommend you Wrox Professional C#.
Saqib
you can get the focus for TextBox try this code in menu click event.;) if (this.textBox1.Focused) { // .... } else if (this.textBox2.Focused) { // .... }
Saqib
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
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
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
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
You need to use Flash ActiveX to view flash files in C#. check here Saqib
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
solution is here Saqib
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
With binding what do you exactly mean, like what would you take or give to that bound file. Saqib
Create a database with new name and export all data of existing database to new one. Saqib
check the following article. http://www.codeproject.com/cs/database/sqldawithoutsqlcb.asp hope this would solve the problem. Saqib