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 Ribbon applications with Windows Forms in .net framework

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Today, I will talk to you about how Windows Forms creates functional area applications in .net framework. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

TX Text Control .NET for Windows Forms is a set of feature-rich word processing controls that provide developers with the word processing capabilities commonly used in Word in the form of reusable controls. It is an ideal choice for applications that require powerful and flexible document processing capabilities.

Click to download TX Text Control .NET for Windows Forms X17 trial version

In this step, add and connect contextual ribbon tabs for table and frame layout tasks

On the form, click the smart tag in the upper-right corner of the ribbon control by clicking the blue File tab title to select the ribbon control. Click Quick Access Toolbar to convert the form to Windows.Forms.Ribbon.RibbonForm.

Select the ribbon control again by clicking the blue title of the File tab and locating the ContextualTabGroups property in the Properties window.

Click the ellipsis button in the (Collection) value column of the ContextualTabGroups property to open the ContextualTabGroup collection editor.

In Collection Editor, click Add to add a new Windows.Forms.Ribbon.ContextualTabGroup, name this group m_grpTableTools, set the Header property to TableTools, and select BackColor.

In Solution Explore, select the form Form1 and select Code from the View main menu. Add the following code, and the complete Form1 class code is as follows:

Code-cs

Public partial class Form1: TXTextControl.Windows.Forms.Ribbon.RibbonForm {public Form1 () {InitializeComponent (); textControl1.InputPositionChanged + = TextControl1_InputPositionChanged; textControl1.FrameSelected + = TextControl1_FrameSelected; textControl1.FrameDeselected + = TextControl1_FrameDeselected; textControl1.DrawingActivated + = TextControl1_DrawingActivated; textControl1.DrawingDeselected + = TextControl1_DrawingDeselected } private void TextControl1_DrawingDeselected (object sender, TXTextControl.DataVisualization.DrawingEventArgs e) {if ((textControl1.Frames.GetItem ()) = = null) & & (textControl1.Drawings.GetActivatedItem () = = null)) {m_grpFrameTools.Visible = false;}} private void TextControl1_DrawingActivated (object sender, TXTextControl.DataVisualization.DrawingEventArgs e) {m_grpFrameTools.Visible = true } private void TextControl1_FrameDeselected (object sender, TXTextControl.FrameEventArgs e) {if ((textControl1.Frames.GetItem ()) = = null) & & (textControl1.Drawings.GetActivatedItem () = = null)) {m_grpFrameTools.Visible = false;}} private void TextControl1_FrameSelected (object sender, TXTextControl.FrameEventArgs e) {m_grpFrameTools.Visible = true } private void TextControl1_InputPositionChanged (object sender, EventArgs e) {m_grpTableTools.Visible = textControl1.Tables.GetItem ()! = null;}}

Code-vb

Public Partial Class Form1 Inherits TXTextControl.Windows.Forms.Ribbon.RibbonForm Public Sub New () InitializeComponent () AddHandler textControl1.InputPositionChanged, AddressOf TextControl1_InputPositionChanged AddHandler textControl1.FrameSelected, AddressOf TextControl1_FrameSelected AddHandler textControl1.FrameDeselected, AddressOf TextControl1_FrameDeselected AddHandler textControl1.DrawingActivated, AddressOf TextControl1_DrawingActivated AddHandler textControl1.DrawingDeselected, AddressOf TextControl1_DrawingDeselected End Sub Private Sub TextControl1_DrawingDeselected (sender As Object E As TXTextControl.DataVisualization.DrawingEventArgs) If (textControl1.Frames.GetItem () Is Nothing) AndAlso (textControl1.Drawings.GetActivatedItem () Is Nothing) Then m_grpFrameTools.Visible = False End If End Sub Private Sub TextControl1_DrawingActivated (sender As Object, e As TXTextControl.DataVisualization.DrawingEventArgs) m_grpFrameTools.Visible = True End Sub Private Sub TextControl1_FrameDeselected (sender As Object) E As TXTextControl.FrameEventArgs) If (textControl1.Frames.GetItem () Is Nothing) AndAlso (textControl1.Drawings.GetActivatedItem () Is Nothing) Then m_grpFrameTools.Visible = False End If End Sub Private Sub TextControl1_FrameSelected (sender As Object, e As TXTextControl.FrameEventArgs) m_grpFrameTools.Visible = True End Sub Private Sub TextControl1_InputPositionChanged (sender As Object, e As EventArgs) m_grpTableTools.Visible = textControl1.Tables.GetItem () IsNot Nothing End Sub End Class

Build and start the application. Insert the table using Table in the Insert ribbon tab. Set the input location to the table so that you can view the table tools tab in context.

After reading the above, do you have any further understanding of how Windows Forms creates ribbon applications in. Net framework? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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: 251

*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

Internet Technology

Wechat

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

12
Report