Ok this is something new to me....
I have a gridview control which is displaying the files and directory names in one column.
Now i want to display the file icon of that particular file in the other column...
eg test.txt will have a different icon form image1.jpg and here.xsl
i have found two examples but don't kno if they will work or not....
http://www.codeproject.com/KB/custom-controls/AssociatedIconsImage.aspx
or
http://forums.asp.net/t/90921.aspx
how to incorporate this with my gridview..?
thanks
I found a source that should be useful for you (and with a simple google query btw.): Getting Associated Icons Using C#
.
As far as I know, there's no other way than using the shell32 library via interop, as used in the given example.
I'm not sure if there is a managed way to this... there very well could be, but the unmanaged way to get this would be to use PInvoke to call SHGetFileInfo. There is sample code on PInvoke.Net which should get you most of the way there.
Related
I have a third party program that I can not modify. It is Calypso for a CMM machine. It can automatically run parts to be checked for defects. The measurements it makes will be spat out as a PDF file that can be set to automatically print.
When Calypso outputs the Save As box to save it to the predefined folder, the File Name box is empty.
I'm trying to make a simple program that has a button on the second monitor that when it is pressed, will generate the time and date to be placed into the File Name box then saved.
I can do everything except I can't seem to get my program to be able to select and enter keys into the File Name box.
From my research I believe I need to use something to FindWindow and SendKeys.
All the examples I have found of it are kinda confusing.
If anyone can give insight into how I could do this, it would be greatly appreciated.
Thank you,
After reading the two comments about simpler solutions to my issue compared to the unreliable nature of C# and UI automation, I went ahead and chose to use AutoHotKey.
Reason being is that the syntax is simpler then AutoIt and easier to learn what I need in order to accomplish my simple task.
Link to AutoHotKey : autohotkey.com
Link to AutoIt : https://www.autoitscript.com/site/
How to get list of macros names that's displayed in tab "Developer" by button "macros"? I found some solution (https://social.msdn.microsoft.com/Forums/vstudio/en-US/ef1de29a-81c7-424a-b7ab-f85286a1d8de/how-to-retrieve-a-list-of-macros-in-an-excel-workbook?forum=vsto), but it's work with button "Visual basic" in same tab. Maybe we can extract macros names from there?
"Maybe we can extract macros names from there?"
Obviously no, you can't.
And the answer in your link already said this "As far as I know, there is no a property which can be used to get the names of macros.".
So there is no built-in way to extract them.
The only way I can imagine is parsing all the code and looking for Function and Sub to collect their names. But this can be cumbersome.
Maybe studying the source code of the Rubberduck AddIn at GitHub can help. I know that such a parsing is implemented there (in C# aswell) as they need it to generate a list of functions/procedures too, so maybe this can help you getting an idea how to implement this.
i would like to know weather it is possible to control some wpf application written in c# by using a c# dll out of matlab.
what i need is the possibility to start the MainWindow and i have to be able
to get some values into my controller.
What i found so far was things working from c# that use matlab, but the other way round seems not to be that much populatet, as i found nothing i could really use.
I allready tried to import a .net Library, but i dont seem to be able to open a external class from my dll.
So if you could help me on this it would be great.
Regards,
justSomeone
Ok, i did just find out, that i can also import my .exe file into Matlab instead of only dlls .
I am using the function NET.addAssebly('Path.exe') to do this.
Path.exe is just a symbol that it is directed to the place of the .exe file.
I achieved to be able to use my methods as i wanted i do have my instance of the class. So i am happy now. :D
But if you have other solutions which are more handy, dont hesitate to post them. There might still be interesting things to discover :)
Regards,
justSomeone
I'm trying to get a file explorer on c# and I have found nothing about this. Is c# provide a file explorer already ready to work?
If not, is TreeView a good idea to create mine? Have you got some link to perform this?
Thanks in advance for these informations.
C# Doesn't provide file explorer tree as it is, but if you want to create a dialog for selecting the folder you can use FolderBrowserDialog(full dialog for folder selection)
However if you want to create one, yes, It is easy to do it with WPF TreeView.
As a hint
Take TreeView, write HiearchyDataProvider which provides files and folders and templates for each node to display icons and so on
P.S.
Simple google search shows a lot of ready-samples
I am unable to get execWB working. Can any one show me how to initialize it or which namespace or dll file I need to include in order to use this method.
I am trying to zoom out the content on my browser.
You are in luck. Someone already wrote the interop for you.
Try looking at this Stackoverflow question. This CodeProject link concerns VB.Net but you might be able to get some useful information from it.