|
I assume you receive the path of the dropped object. If so you could do the following:
bool isDirectory = ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank u both for guiding me.
|
|
|
|
|
how i can create a mobile application in C#.
plz reply me as soon as possible thanks.
|
|
|
|
|
Hello
It depends on what model you want you app to run.
If you are programming for smartphones use .Net compact framework.
If you are programming for symbian use Appforge CrossFire[^].
Regards
|
|
|
|
|
ok
i need a small application on smartphones in C#.thanks
|
|
|
|
|
Create Smart Device application. File -> Project -> Visual C# -> Smart Device
only two letters away from being an asset
|
|
|
|
|
Dear all,
I have add a listbox with following property on
listbox1.DrawMode=OwnerDrawVariable;
listbox1.HorizontalScrollbar=true;
listbox1.ScrollAlwaysVisible=true;
I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine.
Please help.
|
|
|
|
|
Hello
Listboxes implement auto horizontal scroll by default. Why do you do all this?? Once you input an item that has a long enough text, the horizontal scrollbar should appear with the proper size!!
If you want to set this manually -for one reason or the other- don't forget to set ListBox.HorizontalExtent to the right size.
Regards
|
|
|
|
|
Thanks Nader,
My Problem has resolved. I was not using HorizontalExtent. Now i realize this is important property. So very very thanks.
Now I have a samll question too. What is the easiest way to give a shortcut key to a Button in C#. Like Ctrl+S or F6 etc.
Thanks...
|
|
|
|
|
I have been working with RegistryKeys (Create, Delete, Modify) however i do not know how to read the whole registry. I am looking for certain keys, but they end up being all over the place. I need to be able to identify their exact path.
I am working in Windows Forms C#
Thanks
|
|
|
|
|
Hello
oskardiazdeleon wrote: i do not know how to read the whole registry
The registry is a tree of keys. The main 5 are present in the System.Win32.Registry Class. You can access them one by one using recursive calling to scan all subkeys but that will be very lenthy!!
oskardiazdeleon wrote: I need to be able to identify their exact path.
Be carful when -or if- you scan the registry of similar names. You should identify your key by its full name. Besides the registry structue is quite constant for a given windows version. What you are looking for will probably be in the same location on other machines running the same version.
Regards
|
|
|
|
|
Thank you for replying. I appreciate you sharing your knowledge. Are there functions within the Registry class that would allow me to scan it?
Im assuming i have to setup a while statement to read through each key within the the tree.
Would you have any idea of how to start off the syntax?
Thank you I appreciate your help
|
|
|
|
|
Hello
Not a while loop. Here is a sample code of how to go through all keys in the registry using foreach loops and recursive function calling:
private void ScanRegistry()
{
RegistryKey Key;
foreach (string subkey in Registry.ClassesRoot.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.CurrentConfig.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.CurrentUser.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.DynData.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.LocalMachine.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.PerformanceData.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
foreach (string subkey in Registry.Users.GetSubKeyNames())
{
Key = Registry.ClassesRoot.OpenSubKey(subkey);
MessageBox.Show(Key.Name);
ScanKey(Key);
}
}
private void ScanKey(RegistryKey Key)
{
RegistryKey subKey;
foreach (string subkeyname in Key.GetSubKeyNames())
{
subKey = Key.OpenSubKey(subkeyname);
MessageBox.Show(subKey.Name);
ScanKey(subKey);
}
}
Regards
|
|
|
|
|
Hello,
how can I export the summaries (the structured hints for methods, arguments etc.) so that they will be available outside the project?
I've built a DLL with commonly used classes and methods and described it with summaries. Now I would like to make those summaries available for projects that use this DLL.
How this can be done? There must be a way to export the summaries to DLL metadata or so.
Thanks,
Michal
|
|
|
|
|
Hello
MyProject's Properties => Build => At the lower part of the screen check "XML documentaion file" => Specify file location.
NB. The file should be at the same location as your dll when you reference to it from another project.
Regards
|
|
|
|
|
Hi,
I'm developing an application which requires storing a list of MemberID numbers selected from a checkedlistbox into an Access db.
There could potentially be say 100 numbers (or more) in the db that I will need to extract, get their related names and display the names in a listbox.
Short of creating rows for each MemberID, I am thinking of one row with the MemberID values seperated by a space, comma or similar.
Can someone share their experiences with this design and make suggestions as to any better alternatives.
Thanks,
Glen Harvy
|
|
|
|
|
Hello
Modern Dbs are usually Relational in design. Your MemberID must have a relation to something else -Member Name, Group, etc...-, so putting them in one row won't make you able to get these relations. Putting them in cells each in a row all in a table -as long as there are other cells in each row-, won't makea downgrade would it?? If you are storing only numbers in a row, why not using an array rather than a DataTable??
Regards
|
|
|
|
|
Don't store the values in a single field. You lose the entire advantage of having a database at all.
If you store each id in a separate record, you can join the tables when you fetch the data, so that you can fetch all the names with a single query. If you store all the id:s in a single field, you first have to get the id:s, then you have to make a query to fetch the name for every id. That means that you have to run 101 queries against the database instead of a single one, and it gets worse the more id:s you have.
---
b { font-weight: normal; }
|
|
|
|
|
Does anyone have an ico or png or whatever of the exit icon (the white x on red background) that is in almost every computer program! I can't find one anywhere!
Glen Harvy
|
|
|
|
|
You could press print screen and make one, I was looking for some Icon software today and found icofx quite good, or try this code
<br />
using(Bitmap bmp = new Bitmap(16,16))<br />
{<br />
using(Graphics g = Graphics.FromImage(bmp))<br />
{<br />
VisualStyleRenderer r = new VisualStyleRenderer(VisualStyleElement.Window.CloseButton.Normal);<br />
r.DrawBackground(g,new Rectangle(0,0,16,16));<br />
bmp.Save("close.png",ImageFormat.Png);<br />
}<br />
}<br />
|
|
|
|
|
Thanks,
Your code worked like a charm.
I'll check the icofx site out as well later.
Cheers,
Glen Harvy
|
|
|
|
|
I havn't had a lot of time to test anything so maybe the awnser is simple. How can i move a file to attach it to an ADS. I wan't to hide all the files in a directory behind a 0 text file.
for ex.
Move c:\myVidio\movie.avi to C:\myVidio\haha.txt:movie.avi
Move c:\myVidio\movie2.avi to C:\myVidio\haha.txt:movie2.avi
I'm looking to write a utility that can take directories and do this.
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
I am to remove the caption bar from a C# form (VS2005). I've set control box to false and removed the Text Field. The caption is gone but the problem is I can't put i title in the Taskbar. Does anyone know how to do this?
|
|
|
|
|
Set the 'ControlBox' property to false,
Set the 'FormBorderStyle' property to None and
Set the title in 'Text' property.
Regards,
Bhupi Bhai.
|
|
|
|
|
The problem with that is the form is then not resizable, in my current task I need it to be resizable, do you know how to get past this?
Regards,
Chris McGrath
|
|
|
|