Type | Description |
The Create method creates the ActiveX control. The Create method creates the control based on its control's identifier. Use the ControlID and LicenseKey properties to specify the control's identifier and the runtime license key for the control, if required ( please make sure that the runtime license key is not identical with your development license key ). If the Create method fails, the Object property gets nothing. Use the Object property to access the ActiveX control's properties and methods. Use the CloseOn property to specify how the item that hosts an ActiveX control is closed using the mouse. Use the Width and Height properties to specify the size of the item that hosts the ActiveX control. The control fires the OleEvent event when an inside ActiveX control fires an event. The look and feel of the inner ActiveX control depends on the identifier you are using, and the version of the library that implements the ActiveX control, so you need to consult the documentation of the inner ActiveX control you are inserting inside the eXMenu control.
The following VB sample creates a popup menu that hosts an Exontrol.Calendar component:
With ExMenu1 With .Items.Add("Exontrol.<b>Calendar</b>", EXMENULibCtl.SubControl) .ID = 122 With .SubControl .ControlID = "Exontrol.Calendar" .Create With .Object .ShowWeeks = True .ShowTodayButton = False End With End With End With .Refresh End With
The following VB sample displays a HTML document inside a SubControl item:
With ExMenu1 With .Items.Add(" <b>HTML</b> Document ", EXMENULibCtl.SubControl, 1).SubControl .CloseOn = exClick .Width = 196 .Height = 134 .ControlID = "htmlfile" .Create With .Object() .write "<HTML><BODY>" .write "<p>This is a <b>HTML</b> page...</p>" .write "<ul>" .write "<li>1 issue</li>" .write "<li>2 issue</li>" .write "<li>3 issue</li>" .write "</ul>" .write "</BODY></HTML>" End With End With .Refresh End With
The following VB sample adds the Exontrol.ChartView component:
With ExMenu1.Items With .Add(" ActiveX ", EXMENULibCtl.ItemTypeEnum.SubControl, 1234).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.ChartView" .Create With .Object .BeginUpdate .BackColor = RGB(255, 255, 255) .Appearance = 2 .HasButtons = 3 .ButtonsAlign = 0 .PenWidthLink = 3 With .Root .Caption = "Root
Some information here.Line 1: 1 Line 2: 2" .Image = 1 .AddAssistant ("Assistant node") End With With .Nodes With .Add("Item 1", , "Key1") .HasButton = False .LinkTo = "Key2" End With .Add "SubItem 1", "Key1" With .Add("Sub Item 2", , "Key2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O5Hl0GAvCeCweEAYAugoNBgE0BYOiQcAUiaPpij8EBBjINTUi4IIHA4SwMAUEYSNUAxvm6Eg1j6GxwDBEoLDoI4oFcfxOggUA5j4boaBWBpJhKXABD8ZUuACBITkgGhpDmJRmnUYRahechQAGKoSHAHIuiGCZGASYYmhgagTk8OIQjcIBvCqHsNwdRAABAaOAKAwwyAtE4LAboqVnOmDSAoEANhBBVAeDABQ4wrACAIHASAwxXgFAIAAHZAQ" .Picture = s .Expanded = False .ArrangeSiblingNodesAs = 1 End With .Add "SubItem 1", "Key2" .Add "SubItem 2", "Key2" End With .EndUpdate End With End With End With ExMenu1.Refresh
The following C++ sample adds the Exontrol.ChartView component:
#include "Item.h" #include "Menu.h" #include "Control.h" #importCItem item = m_menu.GetItems().Add( " ActiveX ", COleVariant( (long)3 /*SubControl*/ ), COleVariant( (long)1234 ) ); CControl control = item.GetSubControl(); control.SetWidth( 256 ); control.SetHeight( 256 ); control.SetControlID( "Exontrol.ChartView" ); control.Create(); EXORGCHARTLib::IChartViewPtr spChart( control.GetObject() ); if ( spChart != NULL ) { spChart->BeginUpdate(); spChart->BackColor = RGB(255, 255, 255); spChart->Appearance = EXORGCHARTLib::Sunken; spChart->HasButtons = EXORGCHARTLib::exWPlus; spChart->ButtonsAlign = EXORGCHARTLib::UpperLeft; spChart->PenWidthLink = 3; EXORGCHARTLib::INodePtr spRoot = spChart->Root; spRoot->Caption = " Root
Some information here.Line 1: 1 Line 2: 2"; spRoot->Image = 1; spRoot->AddAssistant ("Assistant node", vtMissing, vtMissing); EXORGCHARTLib::INodesPtr spNodes = spChart->Nodes; EXORGCHARTLib::INodePtr spNode1 = spNodes->Add("Item 1", vtMissing , "Key1", vtMissing, vtMissing); spNode1->HasButton = false; spNode1->LinkTo = "Key2"; spNodes->Add("SubItem 1", "Key1", vtMissing, vtMissing, vtMissing ); EXORGCHARTLib::INodePtr spNode2 = spNodes->Add("Sub Item 2", vtMissing, "Key2", vtMissing, vtMissing ); CString s( "gBHJ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weEAYAugoNBgE0BYOiQcAUiaPpij8EBBjINTUi4IIHA4SwMAUEYSNUAxvm6Eg1j6GxwDBEoLDoI4oFcfxOggUA5j4boaBWBpJhKXABD8ZUuACBITkgGhpDmJRmnUYRahechQAGKoSHAHIuiGCZGASYYmhgagTk8OIQjcIBvCqHsNwdRAABAaOAKAwwyAtE4LAboqVnOmDSAoEANhBBVAeDABQ4wrACAIHASAwxXgFAIAAHZAQ"; spNode2->put_Picture( COleVariant( s ) ); spNode2->Expanded = false; spNode2->ArrangeSiblingNodesAs = EXORGCHARTLib::exHorizontally; spNodes->Add("SubItem 1", "Key2", vtMissing, vtMissing, vtMissing ); spNodes->Add("SubItem 2", "Key2", vtMissing, vtMissing, vtMissing ); spChart->EndUpdate(); } m_menu.Refresh();
The C++ sample requires calling the #import <exorgchart.dll> to import definitions for the Exontrol.ChartView component. It generates the EXORGCHARTLib namespace where you can find all objects of the ExOrgChart component.
The following VB.NET sample adds the Exontrol.ChartView component:
With AxExMenu1.Items With .Add(" ActiveX ", EXMENULib.ItemTypeEnum.SubControl, 1234).SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.ChartView" .Create() With .Object .BeginUpdate() .BackColor = RGB(255, 255, 255) .Appearance = 2 .HasButtons = 3 .ButtonsAlign = 0 .PenWidthLink = 3 With .Root .Caption = "Root
Some information here.Line 1: 1 Line 2: 2" .Image = 1 .AddAssistant("Assistant node") End With With .Nodes With .Add("Item 1", , "Key1") .HasButton = False .LinkTo = "Key2" End With .Add("SubItem 1", "Key1") With .Add("Sub Item 2", , "Key2") Dim s As String s = "gBHJJGHA5MIgAEIe4AAAFhwQiAbCAbigbEsWGAlGA7Eo7HcbIowIpFHZQkZQKA7IsplErlBbLZFmEzLZlMpQmxbOE2mxwn06nZ7n0+PdFMtFOCFQp7pR7SFKQtPSFPTdTTdVq9ZTalralr1fWClWFjsi7s1nYtmYtrtjQt1vbdubdzujlublvF5eDleF9eD7v77fYBwmFw2HxGJxWLxmNx2PyGRyWTym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ASAwxXgFAIAAHZAQ" .Picture = s .Expanded = False .ArrangeSiblingNodesAs = 1 End With .Add("SubItem 1", "Key2") .Add("SubItem 2", "Key2") End With .EndUpdate() End With End With End With AxExMenu1.CtlRefresh()
The following C# sample adds the Exontrol.ChartView component:
EXMENULib.Menu items = axExMenu1.Items; EXMENULib.Control control = items.Add(" ActiveX ", EXMENULib.ItemTypeEnum.SubControl, 1234).SubControl; control.Width = 256; control.Height = 256; control.ControlID = "Exontrol.ChartView"; control.Create(); EXORGCHARTLib.ChartView chart = control.Object as EXORGCHARTLib.ChartView; if (chart != null) { chart.BeginUpdate(); chart.BackColor = ToUInt32(Color.White); chart.Appearance = EXORGCHARTLib.AppearanceEnum.Sunken; chart.HasButtons = EXORGCHARTLib.ExpandButtonEnum.exWPlus; chart.ButtonsAlign = EXORGCHARTLib.PictureDisplayEnum.UpperLeft; chart.PenWidthLink = 3; EXORGCHARTLib.Node node = chart.Root; node.Caption = "Root
Some information here.Line 1: 1 Line 2: 2"; node.Image = 1; node.AddAssistant ("Assistant node", null, null); EXORGCHARTLib.Nodes nodes = chart.Nodes; EXORGCHARTLib.Node node1 = nodes.Add("Item 1", null, "Key1", null, null); node1.HasButton = false; node1.LinkTo = "Key2"; nodes.Add("SubItem 1", "Key1", "Key3", null, null); EXORGCHARTLib.Node node2 = nodes.Add("Sub Item 2", null, "Key2", null, null); String s = "gBHJJGHA5MIgAEIe4AAAFhwQiAbCAbigbEsWGAlGA7Eo7HcbIowIpFHZQkZQKA7IsplErlBbLZFmEzLZlMpQmxbOE2mxwn06nZ7n0+PdFMtFOCFQp7pR7SFKQtPSFPTdTTdVq9ZTalralr1fWClWFjsi7s1nYtmYtrtjQt1vbdubdzujlublvF5eDleF9eD7v77fYBwmFw2HxGJxWLxmNx2PyGRyWTymVy2XzGZzWbzmdz2f0Gh0WjzsMAAhfIEAMMf4AFmmhOxIAI1r/BIcJBwEABAQHBQ2FDIOBgAIGB4YODAULCQiIB4cGxoXDQcJERITFBSVBYaICAyGQIQFhsbDAIIERYOCYEGCkaCiYoLDAyNCoEDxMKDAgG1YMZgQFGYpkE0F4vGITAYjGIpFAkEQhEgLBYhmYgDAWBhCBsFh8HgQJCASCYaFYcjqCGBAIBgKhCCwZB6kAAgFgkOBQAQYIAjWABDAqKxYDQcJxEKBgMCMJI0BAeBXiCRAIBGJA+A4RJAlIJoMCWM5sFwQIhkOBwKAsdw3AqFBaBiapOjqQI3A8ZpYHWK4ExgWAWG2YIBnSP4CAgIBGAwQQjAaTgXh8TAmlYDBigMAgtAyXQyiASJzmqA4CEEf5VlAIRim8XwiiPDRzmsQUKhQLAsEqEBJhCAxSBwLZQH+EAIlEYZDAWboNj4AAIiEAhElYAhfnuYoclGAxHAqD4XGAE4EECAkPhAGojmkPgZGoIAsgcSpynACgEhEDBYEyAY"; s = s + "fFSEBhikGxSDKbgngIBgoCAAQ7F6IxoACDRCDwAIwg8SxsAqAYHAQWggAGDgaGAKxEgETIzECOoxkqeoAgUFwiHgbQggKHhwBGAYJHIU4AgOXRahuQQFBQcgr4SAjXgiAYLCoLAIkGERUBgIQxA+QoyEmRwGnqfBgAMHBSCADwDg0Jh4CAAIBgAGGKBCDoqikBYIAochrAGFRaCgAQEA2JgQA0IJmA6ApugYFoEBMaYAgmZh8GCBYSDoUBPjMAoansTAGBcVA4AEPINAQOAAEaDREAIYQCgWFATmgO5Hl0GAvCeCweEAYAugoNBgE0BYOiQcAUiaPpij8EBBjINTUi4IIHA4SwMAUEYSNUAxvm6Eg1j6GxwDBEoLDoI4oFcfxOggUA5j4boaBWBpJhKXABD8ZUuACBITkgGhpDmJRmnUYRahechQAGKoSHAHIuiGCZGASYYmhgagTk8OIQjcIBvCqHsNwdRAABAaOAKAwwyAtE4LAboqVnOmDSAoEANhBBVAeDABQ4wrACAIHASAwxXgFAIAAHZAQ"; node2.Picture = s; node2.Expanded = false; node2.ArrangeSiblingNodesAs = EXORGCHARTLib.ArrangeSiblingEnum.exHorizontally; nodes.Add("SubItem 1", "Key2", "Key4", null, null); nodes.Add("SubItem 2", "Key2", "Key5", null, null); chart.EndUpdate(); } axExMenu1.CtlRefresh();
The C# sample requires a new reference to the Exontrol's ExOrgChart component. Select the Project\Add Reference... and Select COM\ExOrgChart 1.0 Control Library. Once that the component is referred, the EXORGCHARTLib namespace is created, where we can find all objects and definitions for the component being inserted.
The ToUInt32 function converts a Color expression to OLE_COLOR:
private UInt32 ToUInt32(Color c) { long i; i = c.R; i = i + 256 * c.G; i = i + 256 * 256 * c.B; return Convert.ToUInt32(i); }
The following VFP sample adds the Exontrol.ChartView component:
With thisform.ExMenu1.Items With .Add(" ActiveX ", 3, 1234).SubControl && EXMENULibCtl.ItemTypeEnum.SubControl .Width = 256 .Height = 256 .ControlID = "Exontrol.ChartView" .Create With .Object .BeginUpdate .BackColor = RGB(255, 255, 255) .Appearance = 2 .HasButtons = 3 .ButtonsAlign = 0 .PenWidthLink = 3 With .Root .Caption = "Root
Some information here.Line 1: 1 Line 2: 2" .Image = 1 .AddAssistant ("Assistant node") EndWith With .Nodes With .Add("Item 1", , "Key1") .HasButton = .f. .LinkTo = "Key2" EndWith .Add("SubItem 1", "Key1") With .Add("Sub Item 2", , "Key2") local s s = "gBHJJGHA5MIgAEIe4AAAFhwQiAbCAbigbEsWGAlGA7Eo7HcbIowIpFHZQkZQKA7IsplErlBbLZFmEzLZlMpQmxbOE2mxwn06nZ7n0+PdFMtFOCFQp7pR7SFKQtPSFPTdTTdVq9ZTalralr1fWClWFjsi7s1nYtmYtrtjQt1vbdubdzujlublvF5eDleF9eD7v77fYBwm" s = s + "Fw2HxGJxWLxmNx2PyGRyWTymVy2XzGZzWbzmdz2f0Gh0WjzsMAAhfIEAMMf4AFmmhOxIAI1r/BIcJBwEABAQHBQ2FDIOBgAIGB4YODAULCQiIB4cGxoXDQcJERITFBSVBYaICAyGQIQFhsbDAIIERYOCYEGCkaCiYoLDAyNCoEDxMKDAgG1YMZgQFGYpkE0F4vGITAYj" s = s + "GIpFAkEQhEgLBYhmYgDAWBhCBsFh8HgQJCASCYaFYcjqCGBAIBgKhCCwZB6kAAgFgkOBQAQYIAjWABDAqKxYDQcJxEKBgMCMJI0BAeBXiCRAIBGJA+A4RJAlIJoMCWM5sFwQIhkOBwKAsdw3AqFBaBiapOjqQI3A8ZpYHWK4ExgWAWG2YIBnSP4CAgIBGAwQQjAaTgXh" s = s + "8TAmlYDBigMAgtAyXQyiASJzmqA4CEEf5VlAIRim8XwiiPDRzmsQUKhQLAsEqEBJhCAxSBwLZQH+EAIlEYZDAWboNj4AAIiEAhElYAhfnuYoclGAxHAqD4XGAE4EECAkPhAGojmkPgZGoIAsgcSpynACgEhEDBYEyAYfFSEBhikGxSDKbgngIBgoCAAQ7F6IxoACDRCD" s = s + "wAIwg8SxsAqAYHAQWggAGDgaGAKxEgETIzECOoxkqeoAgUFwiHgbQggKHhwBGAYJHIU4AgOXRahuQQFBQcgr4SAjXgiAYLCoLAIkGERUBgIQxA+QoyEmRwGnqfBgAMHBSCADwDg0Jh4CAAIBgAGGKBCDoqikBYIAochrAGFRaCgAQEA2JgQA0IJmA6ApugYFoEBMaYAg" s = s + "mZh8GCBYSDoUBPjMAoansTAGBcVA4AEPINAQOAAEaDREAIYQCgWFATmgO5Hl0GAvCeCweEAYAugoNBgE0BYOiQcAUiaPpij8EBBjINTUi4IIHA4SwMAUEYSNUAxvm6Eg1j6GxwDBEoLDoI4oFcfxOggUA5j4boaBWBpJhKXABD8ZUuACBITkgGhpDmJRmnUYRahechQA" s = s + "GKoSHAHIuiGCZGASYYmhgagTk8OIQjcIBvCqHsNwdRAABAaOAKAwwyAtE4LAboqVnOmDSAoEANhBBVAeDABQ4wrACAIHASAwxXgFAIAAHZAQ" .Picture = s .Expanded = .f. .ArrangeSiblingNodesAs = 1 EndWith .Add("SubItem 1", "Key2") .Add("SubItem 2", "Key2") EndWith .EndUpdate EndWith EndWith EndWith thisform.ExMenu1.Object.Refresh