Text under button C#

Text under button C#

Matic_Mesaric
Contributor Contributor
506 Views
4 Replies
Message 1 of 5

Text under button C#

Matic_Mesaric
Contributor
Contributor

Hello,

 

I am trying to implement custom ribbon tab with custom buttons with C#. I would like to put text under the button wrapping it if the text is too long. 

So instead of looking like this

Matic_Mesaric_0-1747815734659.png


to look more like this

Matic_Mesaric_1-1747815787160.png

 

the part of code for button right now I have, it is like this:

 

RibbonButton updateTipButton = new RibbonButton
{
    Name = "Update TIP text.",
    Text = "TIP Update",
    ShowText = true,
    Size = RibbonItemSize.Large,
    LargeImage = Resource1.ArrowUpdate_mod.ToBitmapImage(),
    ShowImage = true,
    CommandHandler = new RibbonCommandHandler("UPDATETIP"),
    
};

 

Is there any way to fully customize the button or not?

Edit:

 

Found the command to add the:


Orientation = System.Windows.Controls.Orientation.Vertical

 

in the button properties.

Thank you for answers in advance.

BR, Matic

0 Likes
507 Views
4 Replies
Replies (4)
Message 2 of 5

Michiel.Valcke
Advisor
Advisor

Why don't you make the CUI manually in AutoCAD, you can use command macro's to address your dll functions.
What's the benefit of creating the CUI with C#? *genuinely curious*

0 Likes
Message 3 of 5

Matic_Mesaric
Contributor
Contributor

In general this will be used by many users in our company and its just easier if everything happens automatic.

 

Also a lot of additional development will be done even after in use.

 

Just because of this I see it easier to be created with C#.

0 Likes
Message 4 of 5

Michiel.Valcke
Advisor
Advisor

A custom CUI can be used as an 'enterprise' cui, it can be read by multiple users from a common location. When the CUI changes every user will have access to the updated version as soon as they restart the software. The user settings such as an enterprise cui, can be saved in a profile .arg file to roll out more easily to multiple users.

 

https://help.autodesk.com/view/OARX/2026/ENU/?guid=GUID-B7E59965-0B56-4974-BB20-1D61BB96747A

0 Likes
Message 5 of 5

dave.wolfe
Advisor
Advisor

Use the large button style. I think it defaults to text below. You can include a "\n" for a new line character to force wrap the text. Enterprise CUI is ridiculously hard to manage with multiple vertical and versions. Deploying a custom CUI via plugin button is workable though. I write the ribbon in code when it needs to support multi-lingual environments.

Dave Wolfe
Isaiah 57:15

EESignature

Plant 3D Wish list

Piping Labs