Print Page | Close Window

Control.Checked

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=4903
Printed Date: 20 June 2025 at 5:48pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Control.Checked
Posted By: Detlev Schubert
Subject: Control.Checked
Date Posted: 28 August 2006 at 11:40am
Hello,
 
I have a menupoint with two sections, how can I do that, that I can check in the fist part max 2 Items, and in the second part only one Item. Sample:
 
   Item 1
   Item 2
   Item 3
   Item 4
   Item 5
   Item 6
   ---------
   Item 1
   Item 2
   Item 3
 
thx Detlev
  



Replies:
Posted By: Oleg
Date Posted: 28 August 2006 at 12:11pm
Hello,
 
Execure and Update event + variable what control was checked.


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


Posted By: Detlev Schubert
Date Posted: 28 August 2006 at 12:18pm
Hello,
 
nice anwer , but perhaps you have a sample how I can do that ?
 
thx Detlev


Posted By: Oleg
Date Posted: 28 August 2006 at 12:32pm
Hi,
Here code:
 
Dim Checked(1 To 3) As Long

Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
    If (Control.Id >= 100 And Control.Id <= 105) Then
        Checked(2) = Checked(1)
        Checked(1) = Control.Id
    End If

    If (Control.Id >= 120 And Control.Id <= 122) Then
        Checked(3) = Control.Id
    End If
End Sub

Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
   
    If (Control.Id >= 100 And Control.Id <= 105) Then
           Control.Checked = Control.Id = Checked(1) Or Control.Id = Checked(2)
    End If
   
    If (Control.Id >= 120 And Control.Id <= 122) Then
           Control.Checked = Control.Id = Checked(3)
    End If
End Sub

Private Sub Form_Load()
    Dim Popup As CommandBarPopup
    Set Popup = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "Menu")
    With Popup.CommandBar.Controls
        .Add xtpControlButton, 100, "Item 1"
        .Add xtpControlButton, 101, "Item 2"
        .Add xtpControlButton, 102, "Item 3"
        .Add xtpControlButton, 103, "Item 4"
        .Add xtpControlButton, 104, "Item 5"
        .Add xtpControlButton, 105, "Item 6"
       
        Set Control = .Add(xtpControlButton, 120, "Item 1")
        Control.BeginGroup = True
        .Add xtpControlButton, 121, "Item 2"
        .Add xtpControlButton, 122, "Item 3"
    End With
End Sub



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


Posted By: Detlev Schubert
Date Posted: 28 August 2006 at 1:42pm
Hello oleg,
 
you know what you are ?   You are my hero, thx a lot.
 
Why is there no Description for this Control.  I is a very hard work to use this control correctly only with the symbol reference, because this great and fine control is very extensive. In VB you have only a click-event, but here are two, and which is the first event ?
 
kindly regards
Detlev
 
 
 



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