.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RibbonComboBox

1 REPLY 1
Reply
Message 1 of 2
trevor_templeton
520 Views, 1 Reply

RibbonComboBox

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
1 REPLY 1
Message 2 of 2
piction
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost