Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Tab Control - using a picture
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tab Control - using a picture

 Post Reply Post Reply
Author
Message
joolz View Drop Down
Newbie
Newbie


Joined: 28 November 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote joolz Quote  Post ReplyReply Direct Link To This Post Topic: Tab Control - using a picture
    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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2008 at 1:45pm
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:


Private Sub Form_Load()
   With Me.TabControl1
      .PaintManager.ShowIcons = True   ' Make sure TabControl shows icons
      .Icons.LoadBitmap "<PATH TO IMAGE>", 101, xtpImageNormal   ' Add an icon to the TabControl
      .Item(0).Image = 101   ' Attach an icon to the first tab page (0 based)
   End With
End Sub

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
joolz View Drop Down
Newbie
Newbie


Joined: 28 November 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote joolz Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2008 at 2:25pm

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
Back to Top
joolz View Drop Down
Newbie
Newbie


Joined: 28 November 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote joolz Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2008 at 10:43am
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
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2008 at 8:00pm
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
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2008 at 8:07pm
Hi joolz,

Try this:


SSTab1.Icons.AddIcon ImageListTab.ListImages(1).Picture, 101, xtpImageNormal


or


SSTab1.Icons.AddIcon ImageListTab.ListImages(1).ExtractIcon, 101, xtpImageNormal


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

Back to Top
joolz View Drop Down
Newbie
Newbie


Joined: 28 November 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote joolz Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 5:13am
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.
Back to Top
chrisABC View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2008
Status: Offline
Points: 258
Post Options Post Options   Thanks (0) Thanks(0)   Quote chrisABC Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 7:48am
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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 9:45am
Originally posted by joolz joolz wrote:

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
 

Hi,
 
This the contents of the help with LoadIcon

Description

Used to add an icon to the ImageManagerIcons collection of icons from the Handle of the icon.

Syntax

Public Sub AddIcon( _
   ByVal Handle As Long, _
   ByVal Command As Long, _
   ByVal imageState As XTPImageState _
) 

Parameters

Handle
Used to add an icon to the collection of icons from the Handle of the icon.
Command
The id that will be used to identify the icon in the collection of icons.  This can be any positive (non-zero) number.
 
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....
Back to Top
joolz View Drop Down
Newbie
Newbie


Joined: 28 November 2007
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote joolz Quote  Post ReplyReply Direct Link To This Post Posted: 10 June 2008 at 8:17pm
>>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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.