objectarx:2017 リボンを作成

リボンは、頻繁にアクセスするツールや現在のワークスペースと
snapcrab_noname_2016-12-1_22-12-1_no-00

//とりあえずリボンにいれるボタンを作る
RibbonButton button1 = new RibbonButton;
button1.Text = “Button1”;

RibbonButton button2 = new RibbonButton;
button2.Text = “Button2”;

// 背景のリボンを用意して、はじめに作ったリボンを載せる
//リボンは、画面で自由に変化するようにセルに入れていく感じ
RibbonRow row = new RibbonRow();
row.RowItems.Add(button1);
row.RowItems.Add(button2);

//グーループのパネルを作成:
そこに、名前を決めてブロックごと入れる
このようにしておけば、エクセルのリボンと同じ自由に出し入れできる。
例えば使用頻度のログを残しておいて頻度事に切り替える事もできる。
RibbonPanelSource panelSource = new RibbonPanelSource();
panelSource.Title = “Panel1”;
panelSource.Rows.Add(row);

RibbonPanel panel = new RibbonPanel();
panel.Source = panelSource;

//
RibbonTab tab = new RibbonTab();
tab.Title = “Tab1”;
tab.Panels.Add(panel);

RibbonControl ribbon = new RibbonControl();

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です