What I am aiming for is have a similar type of toolbox that is used by Visual C++ Express edition when creating forms etc .
I would like to have a list of items which when one is selected I can drag it and paste it into the main screen (this is PLC program editor) . What type of form tool should one use ?
Is there any way I can add an icon as well for each item.
Yes. For that purpose, you first have to add one or two image lists for the large and/or small icons to the form. (Actually, I think, you can define the image lists anywhere where they are in scope, but to the from you can simply drag them from the toolbox.) After you have filled the image list(s) with Icons, you simply set up the ListViewItem::ImageIndex property of the items. Et viola!
As I had no specific icons at hand, I have simply used the app's default icon provided by the IDE. Doesn't look nice, but demonstrates the principle. I have attached a screenshot of the testing app, where the View property of the list view has been set to SmallIcon. As you can see, the list view even hast categories, though they are not collapsable.
I have also implemented a simple drag & drop that allows me to drag items to the list box on the left side of the form, where then the item's Text property is added. Here are the event handlers involved:
I also tried to bring the icons across as well and tried another listView - this didnt work.
What are the problems you encounter? As you can see from the event handlers I posted above, you have access to the entire ListViewItem object in the drop target. The icon property is a simple integral index into the image list. If both controls refer to the same image list, or at least image lists that have matching icons set up at the respective indices, it should be no big deal. I didn't try that myself yet, though.
Did you get the item tool tips working? I would be interested in how you did this.
What my aim is to have a design sheet where the selected item is then dropped to the place as required in the schematic drawing .
I'm not sure whether a list view is the right control for that purpose. At least you would have to derive a class from ListView and do some drawing yourself. But it might be better do implement the entire control more or less yourself, as that might provide a better fitting structure to map to the model you're working with.
Hi
is there any chance of talking/ or online chatting about my project on Skype. My Skype name is roy_bettesworth .
I am not sure which is the best way for me to proceed. I have an exsisting program which was written in win32 but does not use forms. I thought that using forms which has more upto date features might be easier and then link the two together. The exsisting program uses a window to do the schematics on .
is there any chance of talking/ or online chatting about my project on Skype. My Skype name is roy_bettesworth .
Sorry, I don't have a headset and thus have never seen any use for a Skype account.
I am not sure which is the best way for me to proceed. I have an exsisting program which was written in win32 but does not use forms. I thought that using forms which has more upto date features might be easier and then link the two together. The exsisting program uses a window to do the schematics on .
In that case, I think you can make use of the managed/native interop capabilities of C++/CLI, which are said to be the special strength of that language, and integrate and re-use some of the Win32 code you already have. But as I'm new to the entire world of .NET myself, I can't really tell you much about that by now, because I have not yet used these features. The least I can tell you is that you can, for example, obtain the "classic" Win32 HWND of the wrapped GDI object from any .NET object whose class is derived from Object by using its Handle property.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.