Hi all,
I have been Trying to Create a CUI Combobox, through .net and if User Select any Item in Combobox, then I should call my sub to do some operations,
I have created a CUI Combobox through Partial Customization file , but I don't know how to add my own item in that combobox and if any item is selected then I need to call my sub, also I have attached a image,
can anyone guide me how to achieve it.
Thanks in Advance...
Hi,
The layercontrol in the image is a ToolbarControl added to CUI Toolbar, these are predefined controls you can only add them to a toolbar.
I don't think you can edit the control.
Can you please let me know what is your objective ?
like layercontrol, you can create new ToolbarControl based on control types.
public enum ControlType { LayerControl = 1, LineTypeControl = 2, OPTColorControl = 3, LineWeightControl = 4, RefblknameControl = 5, ArrayEditNameControl = 6, ViewportScaleControl = 7, ViewControl = 8, PlotStyleControl = 9, UCSControl = 10, DimStyleControl = 11, UndoSkinnyButtonControl = 12, RedoSkinnyButtonControl = 13, TxtStyleControl = 14, TblStyleControl = 15, NamedViewControl = 16, WorkspacesControl = 17, MldStyleControl = 18, FindTextControl = 19, ContentSearchControl = 20, CustomControl = 21, _3DNavViewComboCtrl = 5000, _3DNavZoomSliderControl = 5001, _3DNavStepSizeSliderControl = 5002, _3DNavStepsPerSecSliderControl = 5003, _3DNavPointTriplet1 = 5004, _3DNavPointTriplet2 = 5005, LightSliderControl1 = 5006, LightSliderControl2 = 5007, LightSliderControl3 = 5008, LightSliderControl4 = 5009, LightSliderControl5 = 5010, LightColorCorrectCtrl = 5011, RenderStyleControl = 5012, RenderProgressControl = 5013, RenderImageQualityControl = 5014, RenderOutputFileControl = 5015, RenderOutputSizeControl = 5016, VSStylesComboControl = 5017, VSEdgeColorControl = 5018, VSEdgeOverhangSliderControl = 5019, VSJitterEdgeSliderControl = 5020, VSSilhouetteEdgeWidthSliderControl = 5021, VSObscuredEdgeColorControl = 5022, VSIntersectionEdgeColorControl = 5023, LayerStateComboControl = 5024, LayerLockTransparencySliderControl = 5025, LayerFilterComboControl = 5026, TextHeightComboControl = 5027 }
Hi,
The layercontrol in the image is a ToolbarControl added to CUI Toolbar, these are predefined controls you can only add them to a toolbar.
I don't think you can edit the control.
Can you please let me know what is your objective ?
like layercontrol, you can create new ToolbarControl based on control types.
public enum ControlType { LayerControl = 1, LineTypeControl = 2, OPTColorControl = 3, LineWeightControl = 4, RefblknameControl = 5, ArrayEditNameControl = 6, ViewportScaleControl = 7, ViewControl = 8, PlotStyleControl = 9, UCSControl = 10, DimStyleControl = 11, UndoSkinnyButtonControl = 12, RedoSkinnyButtonControl = 13, TxtStyleControl = 14, TblStyleControl = 15, NamedViewControl = 16, WorkspacesControl = 17, MldStyleControl = 18, FindTextControl = 19, ContentSearchControl = 20, CustomControl = 21, _3DNavViewComboCtrl = 5000, _3DNavZoomSliderControl = 5001, _3DNavStepSizeSliderControl = 5002, _3DNavStepsPerSecSliderControl = 5003, _3DNavPointTriplet1 = 5004, _3DNavPointTriplet2 = 5005, LightSliderControl1 = 5006, LightSliderControl2 = 5007, LightSliderControl3 = 5008, LightSliderControl4 = 5009, LightSliderControl5 = 5010, LightColorCorrectCtrl = 5011, RenderStyleControl = 5012, RenderProgressControl = 5013, RenderImageQualityControl = 5014, RenderOutputFileControl = 5015, RenderOutputSizeControl = 5016, VSStylesComboControl = 5017, VSEdgeColorControl = 5018, VSEdgeOverhangSliderControl = 5019, VSJitterEdgeSliderControl = 5020, VSSilhouetteEdgeWidthSliderControl = 5021, VSObscuredEdgeColorControl = 5022, VSIntersectionEdgeColorControl = 5023, LayerStateComboControl = 5024, LayerLockTransparencySliderControl = 5025, LayerFilterComboControl = 5026, TextHeightComboControl = 5027 }
Hi Madhukar,
I don't want to edit layertype Combobox, or even i don't need any predefined Combobox,
just for example I have shown that in image.
I want to create a New Combobox in toolbar, in that Combobox items will be added from the database &
if user select any item, I want to run my sub.
Thanks
Hi,
At the moment API facilitate only to create ToolbarControl of predefined type.
Sorry about that 😞
Hi,
just a try. Maybe it works.
Please insert following references first: AcWindows.dll, AdWindows.dll and following using.
using Autodesk.Windows;
RibbonCombo m_RibbonCombo = new RibbonCombo(); m_RibbonCombo.Items.Add(new object()); m_RibbonCombo.CurrentChanged += M_RibbonCombo_CurrentChanged;
The object can be any object for example a Person. One Point is important: Override the method ToString() with that what you want to see in the Combobox.
Handle the CurrentChanged evant like this:
Version:1.0 StartHTML:00000138 EndHTML:00000901 StartFragment:00000242 EndFragment:00000869 StartSelection:00000242 EndSelection:00000869Snippet
private static void M_RibbonCombo_CurrentChanged(object sender, RibbonPropertyChangedEventArgs e) { object m_Object = (object)e.NewValue; }
I hope it works, but I'm not sure.
Regards Jürgen
Hi,
Please note RibbonCombo is not a CUI control it is a Windows Ribbon Runtime control, these UI changes are not persistent. Pl go through
http://adndevblog.typepad.com/autocad/2012/07/modify-ribbon.html
If you want Ribbon Combo Control on Ribbon Bar instead of Ribbon Toolbar, may be this should achieve your objective.
http://adndevblog.typepad.com/autocad/2012/06/ribbonsplitbutton-with-icons-images.html
Hi Madhukar,
I have downloaded the samples solution from the link you provided for creating Ribbion,
but getting error, attached a snap, could you please guide.
Thanks
Hi,
You need to migrate to latest and use .NET framework 4.6, and also refer AcCoreMgd.dll
I have attached migrated sample targetting .NET 4.6 and AutoCAD 2018.
Please let me know if any further queries.
Hi,
Thanks both..
for your guidance..
any how I got the alternate,
but Looking for CUI Combobox in future...
Can't find what you're looking for? Ask the community or share your knowledge.