Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create Visual Studio Toolbar controls in Ribbon Interface

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to create the Visual Studio toolbar control in the Ribbon interface, which is very detailed and has a certain reference value. Interested friends must read it!

Visual Studio after a long period of development, many users are very familiar with the Visual Studio toolbar, here I would like to post a personal understanding, and discuss with you. In the traditional menu interface, the toolbar is widely used as a useful supplement to the menu. By placing some commonly used commands on the toolbar, we can give users intuitive and quick access to common functions and improve efficiency.

In the Ribbon interface, the Visual Studio toolbar has been further enhanced. In addition to the original toolbar function, the toolbar also has extended functions such as drop-down menus due to the use of command buttons.

The following code demonstrates how to create a Visual Studio toolbar control in the Ribbon interface:

CMFCRibbonPanel* pPanel1 = pCategory- > AddPanel (_ T ("From Toolbar")); / / simplest, create a toolbar pPanel1- > AddToolBar (IDR_TOOLBAR) by specifying a toolbar resource through the AddToolBar () function; / / manually create a toolbar CMFCRibbonPanel* pPanel2 = pCategory- > AddPanel (_ T ("Manual")); / / create a button group CMFCRibbonButtonsGroup* pButtonsGroup1 = new CMFCRibbonButtonsGroup / / add a new button to the button group pButtonsGroup1- > AddButton (new CMFCRibbonButton (ID_RIBBON_GBTN_1, _ T ("), 0); pButtonsGroup1- > AddButton (new CMFCRibbonButton (ID_RIBBON_GBTN_2, _ T ("), 1)); / / create an edit box control CMFCRibbonEdit* pEdit = new CMFCRibbonEdit (ID_RIBBON_GBTN_3, 65); / / set the default text pEdit- > SetEditText (_ T ("Edit")) PButtonsGroup1- > AddButton (pEdit); pButtonsGroup1- > AddButton (new CMFCRibbonButton (ID_RIBBON_GBTN_4, _ T ("), 2)); pButtonsGroup1- > AddButton (ID_RIBBON_GBTN_5, _ T ("), 3)); / / add button groups to the panel pPanel2- > Add (pButtonsGroup1); / / add new button groups and buttons CMFCRibbonButtonsGroup* pButtonsGroup2 = new CMFCRibbonButtonsGroup PButtonsGroup2- > AddButton (new CMFCRibbonButton (ID_RIBBON_GBTN_6, _ T ("), 4)); pButtonsGroup2- > AddButton (new CMFCRibbonButton (ID_RIBBON_GBTN_7, _ T ("), 5)); pButtonsGroup2- > AddButton (ID_RIBBON_GBTN_8, _ T ("), 6)); pButtonsGroup2- > AddButton (ID_RIBBON_GBTN_9, _ T ("), 7); pPanel2- > Add (pButtonsGroup2); CMFCRibbonButtonsGroup* pButtonsGroup3 = new CMFCRibbonButtonsGroup CMFCRibbonButton* pBtn10 = new CMFCRibbonButton (ID_RIBBON_GBTN_10, _ T ("), 8); pBtn10- > SetMenu (IDR_RIBBON_MENU_1); pButtonsGroup3- > AddButton (pBtn10); CMFCRibbonButton* pBtn11 = new CMFCRibbonButton (ID_RIBBON_GBTN_11, _ T ("), 9); / / specify a submenu for the button pBtn11- > SetMenu (IDR_RIBBON_MENU_1, TRUE); pButtonsGroup3- > AddButton (pBtn11); pPanel2- > Add (pButtonsGroup3) The above is all the content of the article "how to create Visual Studio toolbar controls in the Ribbon interface". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report