Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - MDI with popup Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MDI with popup Menu

 Post Reply Post Reply
Author
Message
rplp4 View Drop Down
Groupie
Groupie


Joined: 18 May 2008
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote rplp4 Quote  Post ReplyReply Direct Link To This Post Topic: MDI with popup Menu
    Posted: 19 June 2009 at 9:15pm

 
I have the below code in SyntaxEdit Mouse Up.   When I right click on the Syntax control I do get the menu to pop up and it does work on the MDI form CommandBars_Execute the ID is correct but wheen I try with the code GetDocument.AxSyntaxEdit1.Copy() It does not.   See Code for the Execute below.   Why does it not work??
 
In the popup click the  MdiChildren.Length returns 0  but when I click the button on the ribbon MdiChildren.Length returns the correct
number.
VB.net 2008

Dim Popup As XtremeCommandBars.CommandBar

Dim Control As XtremeCommandBars.CommandBarControl

If (e.button = 2) Then

BringToFront()

Popup = frmMain.CommandBars.Add("Popup", XtremeCommandBars.XTPBarPosition.xtpBarPopup)

With Popup.Controls

.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_CUT, "Cu&t", -1, False)

.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_COPY, "&Copy", -1, False)

.Add(XtremeCommandBars.XTPControlType.xtpControlButton, ID_EDIT_PASTE, "&Paste", -1, False)

End With

Popup.ShowPopup()

End If

 
Execute CODE

'This is buttons on the menu ribbon bar

 

'''''Me.MdiChildren returns returns the correct number of forms

Case ID.ID_EDIT_CUT : GetDocument.AxSyntaxEdit1.Cut()

Case ID.ID_EDIT_COPY : GetDocument.AxSyntaxEdit1.Copy()

Case ID.ID_EDIT_PASTE : GetDocument.AxSyntaxEdit1.Paste()

'This is for pop up menu

Case ID_EDIT_CUT

'''''Me.MdiChildren returns

MessageBox.Show(eventArgs.control.Caption & " clicked", "Button Clicked")

GetDocument.AxSyntaxEdit1.Cut()

'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

'A first chance exception of type 'System.NullReferenceException' occurred in Pad.exe

Case ID_EDIT_COPY

MessageBox.Show(eventArgs.control.Caption & " clicked", "Button Clicked") 'Gets here

GetDocument.AxSyntaxEdit1.Copy() 'error here

'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

'A first chance exception of type 'System.NullReferenceException' occurred in CNC Pad.exe

Case ID_EDIT_PASTE

MessageBox.Show(eventArgs.control.Caption & " clicked", "Button Clicked")

GetDocument.AxSyntaxEdit1.Paste()

'A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

'A first chance exception of type 'System.NullReferenceException' occurred in Pad.exe

Product: Xtreme SuitePro (ActiveX) version 12.0.0
Platform: Vista (64bit) - SP 2
Language: Visual Basic 6.0
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.