.NET

Reply
Active Member
trevor_templeton
Posts: 8
Registered: ‎02-26-2007
Message 1 of 2 (250 Views)

RibbonComboBox

250 Views, 1 Replies
12-08-2008 09:35 AM
I was looking through the ribbon objects and I noticed that there is a ribboncombobox. Has anyone used it I get errors when I attempt to add it to a ribbonrow

RibbonComboBox cmb1 = new RibbonComboBox(); //this line is good
RibbonRow row1 = new RibbonRow();

row1.Items.Add(cmb1); //this causes an error


any help would be great.

Update

i tried
row1.Items.Add(cmb1.RibbonItem);

now I don't get a .net error but autocad crashes on load Edited by: trevor_templeton on Dec 17, 2008 2:13 PM
New Member
piction
Posts: 1
Registered: ‎12-13-2012
Message 2 of 2 (147 Views)

Re: RibbonComboBox

12-13-2012 07:43 AM in reply to: trevor_templeton

Hey,

 

An example :

// Panel2 --Rotate Objects--


Autodesk.Windows.RibbonPanelSource panRotObj = new RibbonPanelSource(); // create source
panRotObj.Title = "Rotate"; // set title
RibbonPanel panel2 = new RibbonPanel{Source = panRotObj}; // create panel with source
Tab.Panels.Add( panel2 );

 

// Button --Rotate-- __Clockwise__
RibbonButton panRotObjButtonRClock = new RibbonButton();
panRotObjButtonRClock.Text = RCLOCK_ID;
panRotObjButtonRClock.ShowText = false;
panRotObjButtonRClock.ShowImage = true;
panRotObjButtonRClock.ToolTip = "Rotates a selected block 90° clockwise";
panRotObjButtonRClock.Image = Images.getBitmap( Properties.Resources.RotClockwise_16x16x32 );
panRotObjButtonRClock.LargeImage = Images.getBitmap( Properties.Resources.RotClockwise_32x32x32 );
panRotObjButtonRClock.CommandHandler = new RibbonCommandHandler();
// Button --Rotate-- __CounterClockwise__
RibbonButton panRotObjButtonRCClock = new RibbonButton();
panRotObjButtonRCClock.Text = RCCLOCK_ID;
panRotObjButtonRCClock.ShowText = false;
panRotObjButtonRCClock.ShowImage = true;
panRotObjButtonRCClock.ToolTip = "Rotates a selected block 90° clockwise";
panRotObjButtonRCClock.Image = Images.getBitmap( Properties.Resources.RotCounterClockWise_16x16x32 );
panRotObjButtonRCClock.LargeImage = Images.getBitmap( Properties.Resources.RotCounterClockWise_32x32x32 );
panRotObjButtonRCClock.CommandHandler = new RibbonCommandHandler();
// Button --Rotate-- __Flip__
RibbonButton panRotObjButtonRFlip = new RibbonButton();
panRotObjButtonRFlip.Text = RFLIP_ID;
panRotObjButtonRFlip.ShowText = false;
panRotObjButtonRFlip.ShowImage = true;
panRotObjButtonRCClock.ToolTip = "Rotates a selected block 180°";
panRotObjButtonRFlip.Image = Images.getBitmap( Properties.Resources.Flip_16x16x32 );
panRotObjButtonRFlip.LargeImage = Images.getBitmap( Properties.Resources.Flip_32x32x32 );
panRotObjButtonRFlip.CommandHandler = new RibbonCommandHandler();

// adding rotate buttons to panel manipulate
panRotObj.Items.Add( panRotObjButtonRClock );
panRotObj.Items.Add( new RibbonRowBreak() );
panRotObj.Items.Add( panRotObjButtonRCClock );
panRotObj.Items.Add( new RibbonRowBreak() );
panRotObj.Items.Add( panRotObjButtonRFlip );

 

 

To place some elements in once column use the RibbonRowBreak object.

 

I hope this helps

Kind regards

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.