Print Page | Close Window

How I can do this..!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12677
Printed Date: 24 November 2024 at 2:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How I can do this..!
Posted By: johsuali
Subject: How I can do this..!
Date Posted: 13 November 2008 at 5:56pm
Hi ..
I want to make a templete like access 2007..how I can do it
thanks



Replies:
Posted By: Oleg
Date Posted: 14 November 2008 at 2:15am
Hi,
 
You can add CommandBarsFrame and add sinlge gallery control.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: johsuali
Date Posted: 14 November 2008 at 11:44am
Hi,
I see in the help file that the CommandBarsFrame it use with the Ms Access..
is there any exemple in the forum for this sample..(vb6 or vs.net)
 
thanks...


Posted By: RedPsyrus
Date Posted: 15 June 2009 at 6:00pm
Hi every body..
is there any folowup for this topic..!
example or some codes..
thanks



-------------
I'm using visual studio 2008 pro and codejock 12.1.1


Posted By: SuperMario
Date Posted: 21 June 2009 at 12:45pm
CommandbarsFrame can be used in almost any environments.  However, some environments such as MS Access REQUIRE CommandBarsFrame.  So yes, you can use it in VB6.

So you just add a single Gallery Control to the CommandBars Frame.

I was able to do this:




Posted By: cmm2006
Date Posted: 22 June 2009 at 1:04pm
SuperMario,
if it's not to much to ask, can you please post a sample (vb6 code) on how to do this?
Thank you


Posted By: RedPsyrus
Date Posted: 22 June 2009 at 5:31pm
Hi SuperMario..
I try to make a litle Example to do The template but it not work ..!
I know there is some errors in the code or in the method
can you help me
here is the project ( in vb net 2008 uploads/20090622_173016_Single_Control.zip - uploads/20090622_173016_Single_Control.zip


if therr another example share it please

thanks







-------------
I'm using visual studio 2008 pro and codejock 12.1.1


Posted By: SuperMario
Date Posted: 22 June 2009 at 7:43pm
I'll post some code up tomorrow, I left the project on my other PC.


Posted By: RedPsyrus
Date Posted: 22 June 2009 at 7:46pm
Thanks ..



-------------
I'm using visual studio 2008 pro and codejock 12.1.1


Posted By: SuperMario
Date Posted: 23 June 2009 at 5:10pm
Image File I use:



Here is the entire contents of the form from which the screenshot I took earlier:

Private Sub Form_Load()
             
    CommandBars.VisualTheme = xtpThemeRibbon
    CommandBars.ActiveMenuBar.Visible = False
    CommandBars.PaintManager.FlatToolBar = True
   
    Dim TabWrite As RibbonTab
    Dim GroupStyles As RibbonGroup, GroupShapes As RibbonGroup
    Dim Control As CommandBarControl
    Dim ControlPopup As CommandBarPopup
    Dim i As Long
   
   
    Dim ControlFile As CommandBarPopup, ControlTheme As CommandBarPopup, ControlAbout As CommandBarControl, ControlPrint As CommandBarPopup
    Dim PopupBar As CommandBar
   
    Dim ToolBar As CommandBar
   
    Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
    ToolBar.ShowExpandButton = False
    ToolBar.EnableDocking xtpFlagStretched
    ToolBar.ModifyStyle XTP_CBRS_GRIPPER, 0
         
    Dim GalleryStyles As CommandBarGallery
    Set GalleryStyles = ToolBar.Controls.Add(xtpControlGallery, ID_GROUP_STYLES, "Styles")
       
    Set ItemsStyles = CommandBars.CreateGalleryItems(ID_GALLERY_STYLES)
   
    ItemsStyles.AddLabel "Featured Online Templates"
   
    ItemsStyles.ItemWidth = 106
    ItemsStyles.ItemHeight = 160
   
    Dim stylesIconArray(1 To 10) As Long
   
    For i = 1 To 10
        ItemsStyles.AddItem (5100 + i), ""
        stylesIconArray(i) = (5100 + i)
    Next i
   
    ItemsStyles.Icons.LoadBitmap App.Path & "\res\GalleryStyles_152x98.png", stylesIconArray, xtpImageNormal
   
    GalleryStyles.Width = 600
    GalleryStyles.Height = 350
    GalleryStyles.SetItemsMargin 4, 4, 4, 4
    GalleryStyles.ShowBorders = True
    GalleryStyles.ShowScrollBar = False
    GalleryStyles.Resizable = xtpAllowResizeHeight Or xtpAllowResizeWidth
   
    Set GalleryStyles.Items = ItemsStyles
End Sub

Private Sub Form_Resize()
    On Error Resume Next
    CommandBars.Move Me.ScaleLeft + 1, Me.ScaleTop + 1, Me.ScaleWidth - 2, Me.ScaleHeight - 2
End Sub



Posted By: Norika
Date Posted: 24 June 2009 at 12:29am
Thank you Mario,
 
I was able to make just the same Form with the code that you taught us! (modified little like below)
Thank you!
Dim WithEvents ItemsStyles As CommandBarGalleryItems
Private Sub Form_Load()
 Const ID_GROUP_STYLES = 2005
 Const ID_GALLERY_STYLES = 2006
    With CommandBars
       
        .VisualTheme = xtpThemeRibbon
        .ActiveMenuBar.Visible = False
        .PaintManager.FlatToolBar = True
       
        Dim i As Long
        Dim ToolBar As CommandBar
       
        Set ToolBar = .Add("Standard", xtpBarTop)
        With ToolBar
            .ShowExpandButton = False
            .ModifyStyle XTP_CBRS_GRIPPER, 0
                 
            Dim GalleryStyles As CommandBarGallery
            Set GalleryStyles = .Controls.Add(xtpControlGallery, ID_GROUP_STYLES, "Styles")
        End With
           
        Set ItemsStyles = .CreateGalleryItems(ID_GALLERY_STYLES)
        With ItemsStyles
            .ItemWidth = 106
            .ItemHeight = 160
        End With
    End With
   
   
    Dim stylesIconArray(1 To 10) As Long
   
    For i = 1 To 10
        ItemsStyles.AddItem (5100 + i), ""
        stylesIconArray(i) = (5100 + i)
    Next i
   
    Call ItemsStyles.Icons.LoadBitmap(App.Path & "\20090623_170829_GalleryStyles_1.png", _
                                      stylesIconArray, _
                                      xtpImageNormal)
    With GalleryStyles
        .Width = 600
        .Height = 350
        .SetItemsMargin 4, 4, 4, 4
        .ShowBorders = True
        .ShowScrollBar = False
        .Resizable = xtpAllowResizeHeight Or xtpAllowResizeWidth
        Set .Items = ItemsStyles
    End With
   
End Sub


Posted By: cmm2006
Date Posted: 27 June 2009 at 6:45pm

Hi All,

I am glad to see that we are able to have a user interface looks like Access 07, but I was wondering how can I be able to do the following:
  1. center the galleryitems in the middle of the screen (under the ribbonbar)
  2. have the galleryitems resize every time the user resize the form
  3. load pictures stored in a folder and assign them to each item (I tried using the following code: GalleryItems.Icons.LoadIcon App.Path & "\LargeIcons\Icons1.ico)"
  4. fire event everytime the user click on one item (I tried but all the items they have the same ID)

thank you



-------------
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1


Posted By: jpbro
Date Posted: 27 June 2009 at 10:16pm
I haven't used the Gallery objects before, so there may be a better way (I hope there is!), but here is a way that I found to determine what item has been clicked (make sure the ItemsStyles object has been declated at the module level WithEvents...i.e. Private WithEvents ItemsStyles as CommandBarGalleryItems):


Private Sub ItemsStyles_DrawItem(ByVal hDC As stdole.OLE_HANDLE, ByVal Gallery As XtremeCommandBars.ICommandBarGallery, ByVal Item As XtremeCommandBars.ICommandBarGalleryItem, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal Enabled As Boolean, ByVal Selected As Boolean, ByVal Pressed As Boolean, ByVal Checked As Boolean, Handled As Variant)
   If Pressed Then
      Debug.Print "Gallery Item Clicked: " & Item.Id
   End If
End Sub



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

Language: Visual Basic 6.0 SP6



Posted By: Norika
Date Posted: 28 June 2009 at 11:51am

I put a CommandBars control on a PictureBox control (Picture1) as owner cntrol then I relocate the buttons whereever I want.

ItemsStyles.ItemWidth  :   each button width
GalleryStyles.Width   :  backside-frame width
Picture1.width(,height,left,top)   : position, size

I can get a button event by CommandBars_Execute event like below.

Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    Dim i As Integer
    i = Control.SelectedItem.id
    If i = 5101 Then
        Form1.Show vbModal
    ElseIf i = 5102 Then
        Form2.Show vbModal
    End If
   
End Sub



Posted By: cmm2006
Date Posted: 28 June 2009 at 4:45pm
Norika,
can you post a sample in how you did it, please ?


-------------
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1


Posted By: Norika
Date Posted: 29 June 2009 at 8:40am

http://forum.codejock.com/uploads/20090629_083957_3GalleryButtons.zip - uploads/20090629_083957_3GalleryButtons.zip

Hi CMM2006,
 
Please see this minmum sample.
 
Regards,
Norika
 
Product: Xtreme SuitePro (ActiveX) version 13.1.0
Platform: Windows Vista Premium (32bit) SP2 & Windows XP Professional - SP3
Language: Visual Basic 6.0 SP6  English/Japanese


Posted By: cmm2006
Date Posted: 29 June 2009 at 12:13pm
Hi Norika,
 really a good job in detecting the item ID, but I am still trying to figure out how to resize the gallerystyles evey time you resize the form.
some help here please


-------------
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1


Posted By: Norika
Date Posted: 06 July 2009 at 1:28am

Hi cmm2006,
please see my sample app.

Regards,
Norika
https://forum.codejock.com/uploads/20090706_012830_ResetAndResizeG.zip - uploads/20090706_012830_ResetAndResizeG.zip



Posted By: cmm2006
Date Posted: 06 July 2009 at 1:35pm
Thank you for sharing, I think a lot of people out there will appreciate the help. thank you again


-------------
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1


Posted By: RedPsyrus
Date Posted: 06 July 2009 at 2:11pm
Hi,,
Good job Norika,, thanks
can you take a change to make the simple like microsoft access 2007
example make the background of the gallery to a single color (no animate)
thanks.. 


-------------
I'm using visual studio 2008 pro and codejock 12.1.1


Posted By: Norika
Date Posted: 06 July 2009 at 10:09pm

Hi, RedPsyrus,

Sorry, I have no idea..



Posted By: cmm2006
Date Posted: 11 July 2009 at 8:15pm
Hi Again,
using the same ItemsStyles, how can I be able to assign the icon to the ItemsStyles using the standard ImageList?
Please help ASAP
Thank you.
 


-------------
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1


Posted By: RedPsyrus
Date Posted: 12 July 2009 at 7:11am
hi,
you can do it by using the index on a control ..



-------------
I'm using visual studio 2008 pro and codejock 12.1.1



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net