Print Page | Close Window

MDI with popup Menu

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=14578
Printed Date: 06 October 2024 at 10:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MDI with popup Menu
Posted By: rplp4
Subject: MDI with popup Menu
Date 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



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