Third party components aside, is there a way to place an icon on a tab? I tried with a canvas but that gives issues in Z-order.
Bumping since I need icons in the tab control on Windows. Any way to do it with declares?
I tried to look in Msdn but it is unclear. The Tab control is part of .Net, and I do not see anything like it in Win32. So a declare can happen only if someone can tell us which class has been used, and if it offers an icon property to use.
However, I tried with canvases and 16x16 pictures, I do not see any issue using arrows to go from one tab to the other. Of course, the canvas must not accept tab, not to disturb tab order and focus. That is probably the best way for now.
[quote=157125:@Michel Bujardet]I tried to look in Msdn but it is unclear. The Tab control is part of .Net, and I do not see anything like it in Win32. So a declare can happen only if someone can tell us which class has been used, and if it offers an icon property to use.
However, I tried with canvases and 16x16 pictures, I do not see any issue using arrows to go from one tab to the other. Of course, the canvas must not accept tab, not to disturb tab order and focus. That is probably the best way for now.[/quote]
Hmm the Java Swing tab control supports icons and it is using Win32, so I bet there is a way to do it. It is just unclear in MSDN as you said.
Thanks for the canvas idea!
Edit: Found these in MSDN TCITEM structure and TCM_SETITEM message
[quote=157156:@Ashot Khachatryan]Hmm the Java Swing tab control supports icons and it is using Win32, so I bet there is a way to do it. It is just unclear in MSDN as you said.
Thanks for the canvas idea![/quote]
I played again with the canvas. There is one issue : if you drag the canvas over the tab, it becomes child of it. So when the tab loses focus, it becomes invisible.
I looked again in Msdn, and finally found a mention of the tab control in the Win32 API http://msdn.microsoft.com/en-us/library/windows/desktop/bb760548(v=vs.85).aspx . Inside is mentioned TabCtrl_SetImageList which seems to allow adding 16x16 icons.
The declare itself does not seem out of this world with the handle of the Tab Controls, but the HIMAGELIST pointer seems a bit less evident http://msdn.microsoft.com/en-us/library/windows/desktop/bb761522(v=vs.85).aspx