Tab Control - using a picture |
Post Reply |
Author | ||
joolz
Newbie Joined: 28 November 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 05 June 2008 at 12:44pm |
|
Hi Guys
We have had the COM Suite for about a year and have really only just got round to using it!
Anyway today I am replacing our VB6 non-unicode controls with Codejock versions (so I can support Japanese customers)
I have a Microsoft SSTAB tab control and on one of the tabs I have a picture instead of text (because its a language implications)..... Works well but is NOT unicode :-(
I would like to do this with the Codejock Tab control but have been unable to do so...
I.E I don't want a tab title such as 'my tab'.... I want a picture on the tab
The helpfile implies that it can be done, but i'm more of a 'try by example' kinda guy..... the help is... well, not much help TBH and there are no examples.
Anyone done this and would like to share the secret?
Many thanks
Julian
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
You need to make sure that the ShowIcons property of the TabControl PaintManager is True, and then you can add icons to the Icons property and set the icon for specific tab pages...For example:
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
joolz
Newbie Joined: 28 November 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
|
Hey fantastic... thanks, I'll give it a go So, you can't do this at design time ..... pity, because there is a nice Custom property box where this could be included... Thanks again
|
||
joolz
Newbie Joined: 28 November 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
|
Hi.... still having a few 'issues' here :-)
I can get it to display an icon from disc but not from an Imagelist
(ps my CJ Tab is called SSTab1 because its a direct replacement for the 'old' SSTab)
So...
SSTab1.Icons.LoadBitmap App.Path & "\graphics\spanner6.bmp", 101, xtpImageNormal
SSTab1.Item(1).Image = 101
This works fine.... however, I don't want to load the image from the HD... I want to load it from a standard Image list .....
Something like,
SSTab1.Icons.LoadBitmap ImageListTab.ListImages(1).picture, 101, xtpImageNormal
This does not work despite the image being in the Imagelist...
As a test the command
Picture1.picture = ImageListTab.ListImages(1).picture .... works fine
Any ideas guys?
Thanks
Julian
|
||
Bernie
Senior Member Joined: 05 July 2007 Location: Taiwan Status: Offline Points: 109 |
Post Options
Thanks(0)
|
|
My way is stupid but works.
After your code:Picture1.picture = ImageListTab.ListImages(1).picture
SavePicture to the disk and then Load from the disk:
SSTab1.Icons.LoadBitmap App.Path & "\graphics\spanner6.bmp", 101, xtpImageNormal
|
||
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi joolz, Try this:
or
They both seem to work, but I'm not sure what the difference is. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
joolz
Newbie Joined: 28 November 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
|
YES.........
the SSTab1.Icons.AddIcon ImageListTab.ListImages(1).ExtractIcon, 101, xtpImageNormal
Worked....
Funny though, the other method didn't work for me
SSTab1.Icons.AddIcon ImageListTab.ListImages(1).Picture, 101, xtpImageNormal
Many thanks
Oh and Bernie.... very sneaky method, that certainly would have worked, but for obvious reasons I will go with the 'internal' command
Thanks again guys....
I'm just getting to grips with the CJ stuff and its great.... TBH though I am finding the help a bit of a trial and its certainly not as good as the software which is a great shame.
|
||
chrisABC
Senior Member Joined: 05 June 2008 Status: Offline Points: 258 |
Post Options
Thanks(0)
|
|
I agree about the help. But the way I see it, would you rather have good software and poor help, or excellent help and ........?? So I think they got it the right way round.
I have only just started using SuitePro so I am having to learn all about it from the sample code. One thing I've noted is that the help files often contain the same code (as examples) but with lots of useful comments added. A bit of cut and paste (from help file to sample code) makes the samples more readable. (might be an idea, CodeJock??), And of course we have this excellent forum to ask question in.... |
||
Chris (Manchester, UK) -- www.abc6.co.uk ---- Using CodeJock ActiveX Suite 13.1.0 with Windows8, VB6 SP6
|
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi,
This the contents of the help with LoadIcon
DescriptionUsed to add an icon to the ImageManagerIcons collection of icons from the Handle of the icon. SyntaxPublic Sub AddIcon( _
ByVal Handle As Long, _
ByVal Command As Long, _
ByVal imageState As XTPImageState _
)
Parameters
SSTab1.Icons.AddIcon ImageListTab.ListImages(1).Picture.Handle, 101, xtpImageNormal
That's why your option didn't work
|
||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
||
joolz
Newbie Joined: 28 November 2007 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
|
>>Picture.Handle
Yup, its all there...... I guess its just a case of getting a 'hwnd' on the way the CJ code help works
PS Chris .... fully agree about Code vs Help ... and I am cr*p at writing help myself...
What we do here is get one of the Developers who has not worked on a particular code section to write the help for it (so they are newbies)..... That way you invariably get a help file that Users can actually use and get up to speed quickly.... We also use Shockwave more than html thesedays to get over concepts.
Anyway.... great forum
|
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |