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 give a general introduction to Visual Studio tool gallery

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

Share

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

This article will explain in detail how to introduce the Visual Studio tool gallery in detail. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

After learning Visual Studio 2010 for a long time, I would like to share with you that an important innovation in the Ribbon interface is that you can visually preview the execution of commands through the Visual Studio Toolgallery (CMFCRibbonGallery) control. You must have learned a lot after reading this article. I hope this article can teach you more. For example, the paragraph formatting of Word 2007 shows the format visually through the Visual Studio tool gallery, which greatly reduces the process for users to find the right format by constantly trying various parameters.

Let's take a look at how to create a new interactive tool called Visual Studio Toolgallery. The following code demonstrates the creation of the Visual Studio toolbar control:

CMFCRibbonPanel* pPanel1 = pCategory- > AddPanel (_ T ("Standard"))

/ / create a standard toolbar control, where IDB_RIBBON_PALETTE_1 specifies the

/ / the icons of each button in the tool gallery to preview the effect of the command.

PPanel1- > Add (new CMFCRibbonGallery (ID_RIBBON_PBTN_1)

_ T ("Embedded"), 0,0, IDB_RIBBON_PALETTE_1, 64))

/ / Toolgallery controls for button mode

/ / Toolgallery controls in button mode can reduce the occupation of panel space.

CMFCRibbonGallery* pBtn2 = new CMFCRibbonGallery (ID_RIBBON_PBTN_2

_ T ("Button"), 1, 1, IDB_RIBBON_PALETTE_1, 64)

/ / set the panel button to button mode and Gallery mode by default

PBtn2- > SetButtonMode ()

PBtn2- > SetAlwaysLargeImage ()

PPanel1- > Add (pBtn2)

CMFCRibbonPanel* pPanel2 = pCategory- > AddPanel (_ T ("Extended"))

/ / set up the layout of a pair of tool galleries

CMFCRibbonGallery* pBtn3 = new CMFCRibbonGallery (ID_RIBBON_PBTN_3

_ T ("Resize Vertical"), 2, 2, IDB_RIBBON_PALETTE_1, 64)

PBtn3- > SetButtonMode ()

/ / sets the number of columns for the drop-down command button container (Gallery) in button mode

PBtn3- > SetIconsInRow (2)

PBtn3- > EnableMenuResize (TRUE, TRUE)

PPanel2- > Add (pBtn3)

CMFCRibbonGallery* pBtn4 = new CMFCRibbonGallery (ID_RIBBON_PBTN_4

_ T ("Resize Both"), 3, 3, IDB_RIBBON_PALETTE_1, 64)

PBtn4- > SetButtonMode ()

/ / set the layout of command buttons through SetIconInRow () and EnableMenuResize ()

PBtn4- > SetIconsInRow (4)

PBtn4- > EnableMenuResize (TRUE)

PPanel2- > Add (pBtn4)

CMFCRibbonGallery* pBtn5 = new CMFCRibbonGallery (ID_RIBBON_PBTN_5

_ T ("Groups & & Subitems"), 4,4)

/ / Group command buttons through the AddGroup () function

PBtn5- > AddGroup (_ T ("Group 1"), IDB_RIBBON_PALETTE_1, 64)

PBtn5- > AddGroup (_ T ("Group 2"), IDB_RIBBON_PALETTE_2, 64)

PBtn5- > SetButtonMode ()

PBtn5- > SetIconsInRow (4)

PBtn5- > EnableMenuResize (TRUE)

/ / add subitems to the button (button)

PBtn5- > AddSubItem (new CMFCRibbonButton (ID_RIBBON_MENU_ITEM_1, _ T ("Item 1")

PBtn5- > AddSubItem (new CMFCRibbonButton (ID_RIBBON_MENU_ITEM_2, _ T ("Item 2")

PBtn5- > AddSubItem (new CMFCRibbonButton (ID_RIBBON_MENU_ITEM_3, _ T ("Item 3")

PPanel2- > Add (pBtn5)

This is the end of the general introduction to the Visual Studio tool gallery. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

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