How to convert VB "set" function to Fivewin
How to convert VB "set" function to Fivewin
How to convert VB "set" function to Fivewin
VB sample code
'Declare a Ribbon Bar object
Dim RibbonBar As RibbonBar
'Add a Ribbon Bar to the command bars
Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
'Specify the Ribbon Bar is to use the stretched docking style. The Ribbon Bar
'can only be docked to the top or bottom of an application
RibbonBar.EnableDocking xtpFlagStretched
Dim ControlFile As CommandBarPopup
'Add a normal popup to the Ribbon Bar.
Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
'Add commands to the popup
With ControlFile.CommandBar.Controls
.Add xtpControlButton, ID_FILE_NEW, "&New"
.Add xtpControlButton, ID_FILE_OPEN, "&Open..."
Set Control = .Add(xtpControlButton, ID_APP_EXIT, "E&xit")
Control.BeginGroup = True
End With
.......
could anyone help me convert the following code to fivewin
1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
Thanks !!!
VB sample code
'Declare a Ribbon Bar object
Dim RibbonBar As RibbonBar
'Add a Ribbon Bar to the command bars
Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
'Specify the Ribbon Bar is to use the stretched docking style. The Ribbon Bar
'can only be docked to the top or bottom of an application
RibbonBar.EnableDocking xtpFlagStretched
Dim ControlFile As CommandBarPopup
'Add a normal popup to the Ribbon Bar.
Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
'Add commands to the popup
With ControlFile.CommandBar.Controls
.Add xtpControlButton, ID_FILE_NEW, "&New"
.Add xtpControlButton, ID_FILE_OPEN, "&Open..."
Set Control = .Add(xtpControlButton, ID_APP_EXIT, "E&xit")
Control.BeginGroup = True
End With
.......
could anyone help me convert the following code to fivewin
1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
Thanks !!!
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Dixon,
Assuming that CommandBars is an ActiveX object:
>1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
local hRibbonBar := CommandBars:Do( "AddRibbonBar", "RibbonBar" )
> 2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
local hControls := OleGetProperty( hRibbonBar, "Controls" )
local hControlFile := OleInvoke( hControls, "Add", xtpControlPopup, -1, "&File", 1)
Assuming that CommandBars is an ActiveX object:
>1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
local hRibbonBar := CommandBars:Do( "AddRibbonBar", "RibbonBar" )
> 2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
local hControls := OleGetProperty( hRibbonBar, "Controls" )
local hControlFile := OleInvoke( hControls, "Add", xtpControlPopup, -1, "&File", 1)
Dear Antonio
It's very kindly of you to help me out
1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
It's ok now
But I still have problem for the following commands
Could you help me this AGAIN !
'Add commands to the popup
With ControlFile.CommandBar.Controls
.Add xtpControlButton, ID_FILE_NEW, "&New"
.Add xtpControlButton, ID_FILE_OPEN, "&Open..."
Set Control = .Add(xtpControlButton, ID_APP_EXIT, "E&xit")
Control.BeginGroup = True
End With
Thank you very much !
Best regards !
Dixon Chu
It's very kindly of you to help me out
1. Set RibbonBar = CommandBars.AddRibbonBar("Ribbon Bar")
2. Set ControlFile = RibbonBar.Controls.Add(xtpControlPopup, -1, "&File", 1)
It's ok now
But I still have problem for the following commands
Could you help me this AGAIN !
'Add commands to the popup
With ControlFile.CommandBar.Controls
.Add xtpControlButton, ID_FILE_NEW, "&New"
.Add xtpControlButton, ID_FILE_OPEN, "&Open..."
Set Control = .Add(xtpControlButton, ID_APP_EXIT, "E&xit")
Control.BeginGroup = True
End With
Thank you very much !
Best regards !
Dixon Chu
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hello Antonio,Antonio Linares wrote:Dixon,
> With ControlFile.CommandBar.Controls
local hCommandBar := OleGetProperty( hControlFile, "CommandBar" )
local hControls := OleGetProperty( hCommandBar, "Controls" )
Its easy
Could you try to convert these code to FWH?
Code: Select all
Private Sub CommandBars_Execute(ByVal Control As XtremeCommandBars.ICommandBarControl)
Select Case Control.Id
Case ID_APP_ABOUT: MsgBox "Version " & App.Major & "." & App.Minor & "." & App.Revision
Case ID_FILE_NEW: MsgBox Control.Caption & " Clicked"
Case ID_FILE_OPEN: MsgBox Control.Caption & " Clicked"
Case ID_FILE_CLOSE: MsgBox Control.Caption & " Clicked"
Case ID_FILE_SAVE: MsgBox Control.Caption & " Clicked"
Case ID_APP_EXIT: Unload Me
Case ID_VIEW_STATUS_BAR:
CommandBars.StatusBar.Visible = Not CommandBars.StatusBar.Visible
CommandBars.RecalcLayout
Case ID_EDIT_CUT:
Clipboard.SetText txtClient.SelText
txtClient.SelText = vbNullString
Case ID_EDIT_COPY: Clipboard.SetText txtClient.SelText
Case ID_EDIT_PASTE: txtClient.SelText = Clipboard.GetText
Case Else:
MsgBox Control.Caption & " clicked", vbOKOnly, "Button Clicked"
End Select
End Sub
Regards,
Richard
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Richard,
Code: Select all
function CommandBars_Execute( hControl )
do case
case OleGetProperty( hControl, "Id" ) == ID_APP_ABOUT
...
endcase
return nil
Hello Antonio,Antonio Linares wrote:Richard,Code: Select all
function CommandBars_Execute( hControl ) do case case OleGetProperty( hControl, "Id" ) == ID_APP_ABOUT ... endcase return nil
How to put this function when we clicked?
Code: Select all
local hControls := OleGetProperty( hRibbonBar, "Controls" )
local hControlFile := OleInvoke( hControls, "Add", xtpControlPopup, -1, "&File", 1)
Regards,
Richard
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: