C# 图形化的导航界面的设计方法

news2025/6/7 21:32:18

目录

一、涉及到的知识点

1、BackColor属性

2、FlatStyle属性

3、TextlmageRelation属性

4、其它共性设计

二、设计实例

1、 Resources.Designer.cs

2、Form1.Designer.cs

3、Form1.cs

4、运行结果


        图形化导航用于代替文字导航,比如对Button控件 进行图形化导航:“图片+文本”。

一、涉及到的知识点

        对Button控件 进行图形化导航会用到Button控件的BackColor、FlatStyle和TextlmageRelation属性。

1、BackColor属性

        该属性主要用来获取或设置控件的背景色。语法格式如下:

public override Color BackColor {get;set;}
参数说明
属性值:一个表示背景色的Color值。

2、FlatStyle属性

该属性主要用来获取或设置按钮控件的平面样式外观。语法格式如下:

public FlatStyle FlatStyle{get;set;}
参数说明
属性值:FlatStyle值之一。默认值为Standard。

3、TextlmageRelation属性

        该属性主要用来获取或设置文本和图像相互之间的相对位置。语法格式如下:

public TextlmageRelation TextImageRelation{get;set;}
参数说明
属性值:TextlmageRelation的值之一。默认值为Overlay。

4、其它共性设计

         方法中会使用共性设计:Resources.Designer.cs图片资源管理器的设计及资源的加载方法;详见本文作者写的其他文章:C#手动改变自制窗体的大小-CSDN博客 https://wenchm.blog.csdn.net/article/details/137027140

        MenuStrip控件、SplitContainer控件、ImageList组件、toolStrip1控件的设计参考本文作者写的其他文章:C#设计一个带导航菜单的主界面的应用案例-CSDN博客  https://wenchm.blog.csdn.net/article/details/137610195

         对Button控件图形化导航,本文使用了2种方法加载图片:其一,采用图片资源管理器加载图片;其二,采用ImageList组件的图片集合加载图片。

// 
// button1~3采用资源管理器加载导航图片
// 
button1.BackColor = Color.Transparent;
button1.FlatStyle = FlatStyle.Flat;
button1.Image = Properties.Resources._6;
button1.ImageAlign = ContentAlignment.MiddleLeft;
button1.Location = new Point(65, 94);
button1.Name = "button1";
button1.Size = new Size(100, 48);
button1.TabIndex = 0;
button1.Text = "基本信息";
button1.TextImageRelation = TextImageRelation.ImageBeforeText;
button1.UseVisualStyleBackColor = false;
button1.Click += Button1_Click;
// 
// button4~12采用ImageList控件图片集合加载导航图片
// 
button4.BackColor = Color.Transparent;
button4.FlatStyle = FlatStyle.Flat;
button4.ImageAlign = ContentAlignment.MiddleLeft;
button4.ImageIndex = 5;
button4.ImageList = imageList1;
button4.Location = new Point(50, 94);
button4.Name = "button4";
button4.Size = new Size(100, 48);
button4.TabIndex = 0;
button4.Text = "供应商信息";
button4.TextImageRelation = TextImageRelation.ImageBeforeText;
button4.UseVisualStyleBackColor = false;
button4.Visible = false;

二、设计实例

1、 Resources.Designer.cs

//------------------------------------------------------------------------------
// <auto-generated>
//     此代码由工具生成。
//     运行时版本:4.0.30319.42000
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

namespace _177.Properties
{
    using System;


    /// <summary>
    ///   一个强类型的资源类,用于查找本地化的字符串等。
    /// </summary>
    // 此类是由 StronglyTypedResourceBuilder
    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
    // (以 /str 作为命令选项),或重新生成 VS 项目。
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources
    {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources()
        {
        }

        /// <summary>
        ///   返回此类使用的缓存的 ResourceManager 实例。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager
        {
            get
            {
                if (object.ReferenceEquals(resourceMan, null))
                {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_177.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   重写当前线程的 CurrentUICulture 属性,对
        ///   使用此强类型资源类的所有资源查找执行重写。
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture
        {
            get
            {
                return resourceCulture;
            }
            set
            {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _03
        {
            get
            {
                object obj = ResourceManager.GetObject("_03", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _031
        {
            get
            {
                object obj = ResourceManager.GetObject("_031", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _09
        {
            get
            {
                object obj = ResourceManager.GetObject("_09", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _18
        {
            get
            {
                object obj = ResourceManager.GetObject("_18", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _24
        {
            get
            {
                object obj = ResourceManager.GetObject("_24", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _6
        {
            get
            {
                object obj = ResourceManager.GetObject("_6", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap _8
        {
            get
            {
                object obj = ResourceManager.GetObject("_8", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        /// <summary>
        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
        /// </summary>
        internal static System.Drawing.Bitmap C_编程词典
        {
            get
            {
                object obj = ResourceManager.GetObject("C_编程词典", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }

        internal static Bitmap GetObject(string v)
        {
            return v switch
            {
                "C_编程词典" => C_编程词典,
                "_09" => _09,
                "_8" => _8,
                "_18" => _18,
                "_6" => _6,
                "_03" => _03,
                "_24" => _24,
                "_031" => _031,
                _ => null
            };
        }
    }
}

2、Form1.Designer.cs

namespace _177
{
    partial class Form1
    {
        /// <summary>
        ///  Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        ///  Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        ///  Required method for Designer support - do not modify
        ///  the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            menuStrip1 = new MenuStrip();
            toolStripMenuItem1 = new ToolStripMenuItem();
            toolStripMenuItem2 = new ToolStripMenuItem();
            toolStripMenuItem3 = new ToolStripMenuItem();
            toolStripMenuItem4 = new ToolStripMenuItem();
            toolStripMenuItem5 = new ToolStripMenuItem();
            toolStrip1 = new ToolStrip();
            toolStripButton1 = new ToolStripButton();
            toolStripButton2 = new ToolStripButton();
            toolStripButton3 = new ToolStripButton();
            splitContainer1 = new SplitContainer();
            imageList1 = new ImageList(components);
            button1 = new Button();
            button2 = new Button();
            button3 = new Button();
            button4 = new Button();
            button5 = new Button();
            button6 = new Button();
            button7 = new Button();
            button8 = new Button();
            button9 = new Button();
            button10 = new Button();
            button11 = new Button();
            button12 = new Button();
            menuStrip1.SuspendLayout();
            toolStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
            splitContainer1.Panel1.SuspendLayout();
            splitContainer1.Panel2.SuspendLayout();
            splitContainer1.SuspendLayout();
            SuspendLayout();
            // 
            // menuStrip1
            // 
            menuStrip1.Items.AddRange(new ToolStripItem[] { toolStripMenuItem1, toolStripMenuItem2, toolStripMenuItem3, toolStripMenuItem4, toolStripMenuItem5 });
            menuStrip1.Location = new Point(0, 0);
            menuStrip1.Name = "menuStrip1";
            menuStrip1.Size = new Size(644, 25);
            menuStrip1.TabIndex = 0;
            menuStrip1.Text = "menuStrip1";
            // 
            // toolStripMenuItem1
            // 
            toolStripMenuItem1.Name = "toolStripMenuItem1";
            toolStripMenuItem1.Size = new Size(68, 21);
            toolStripMenuItem1.Text = "系统设置";
            // 
            // toolStripMenuItem2
            // 
            toolStripMenuItem2.Name = "toolStripMenuItem2";
            toolStripMenuItem2.Size = new Size(92, 21);
            toolStripMenuItem2.Text = "基本信息管理";
            // 
            // toolStripMenuItem3
            // 
            toolStripMenuItem3.Name = "toolStripMenuItem3";
            toolStripMenuItem3.Size = new Size(92, 21);
            toolStripMenuItem3.Text = "登记信息管理";
            // 
            // toolStripMenuItem4
            // 
            toolStripMenuItem4.Name = "toolStripMenuItem4";
            toolStripMenuItem4.Size = new Size(68, 21);
            toolStripMenuItem4.Text = "信息查询";
            // 
            // toolStripMenuItem5
            // 
            toolStripMenuItem5.Name = "toolStripMenuItem5";
            toolStripMenuItem5.Size = new Size(68, 21);
            toolStripMenuItem5.Text = "日志管理";
            // 
            // toolStrip1
            // 
            toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripButton1, toolStripButton2, toolStripButton3 });
            toolStrip1.Location = new Point(0, 25);
            toolStrip1.Name = "toolStrip1";
            toolStrip1.RenderMode = ToolStripRenderMode.Professional;
            toolStrip1.Size = new Size(644, 25);
            toolStrip1.TabIndex = 1;
            toolStrip1.Text = "toolStrip1";
            // 
            // toolStripButton1
            // 
            toolStripButton1.Image = Properties.Resources._03;
            toolStripButton1.ImageTransparentColor = Color.Magenta;
            toolStripButton1.Name = "toolStripButton1";
            toolStripButton1.Size = new Size(76, 22);
            toolStripButton1.Text = "系统登录";
            // 
            // toolStripButton2
            // 
            toolStripButton2.Image = Properties.Resources._8;
            toolStripButton2.ImageTransparentColor = Color.Magenta;
            toolStripButton2.Name = "toolStripButton2";
            toolStripButton2.Size = new Size(76, 22);
            toolStripButton2.Text = "零件入库";
            // 
            // toolStripButton3
            // 
            toolStripButton3.Image = Properties.Resources._18;
            toolStripButton3.ImageTransparentColor = Color.Magenta;
            toolStripButton3.Name = "toolStripButton3";
            toolStripButton3.Size = new Size(76, 22);
            toolStripButton3.Text = "零件出库";
            // 
            // splitContainer1
            // 
            splitContainer1.Dock = DockStyle.Fill;
            splitContainer1.Location = new Point(0, 50);
            splitContainer1.Name = "splitContainer1";
            // 
            // splitContainer1.Panel1
            // 
            splitContainer1.Panel1.BackgroundImage = Properties.Resources.C_编程词典;
            splitContainer1.Panel1.Controls.Add(button3);
            splitContainer1.Panel1.Controls.Add(button2);
            splitContainer1.Panel1.Controls.Add(button1);
            // 
            // splitContainer1.Panel2
            // 
            splitContainer1.Panel2.BackgroundImage = Properties.Resources.C_编程词典;
            splitContainer1.Panel2.BackgroundImageLayout = ImageLayout.Stretch;
            splitContainer1.Panel2.Controls.Add(button12);
            splitContainer1.Panel2.Controls.Add(button11);
            splitContainer1.Panel2.Controls.Add(button10);
            splitContainer1.Panel2.Controls.Add(button9);
            splitContainer1.Panel2.Controls.Add(button8);
            splitContainer1.Panel2.Controls.Add(button7);
            splitContainer1.Panel2.Controls.Add(button6);
            splitContainer1.Panel2.Controls.Add(button5);
            splitContainer1.Panel2.Controls.Add(button4);
            splitContainer1.Size = new Size(644, 396);
            splitContainer1.SplitterDistance = 214;
            splitContainer1.TabIndex = 0;
            // 
            // imageList1
            // 
            imageList1.ColorDepth = ColorDepth.Depth32Bit;
            imageList1.ImageStream = (ImageListStreamer)resources.GetObject("imageList1.ImageStream");
            imageList1.Tag = "";
            imageList1.TransparentColor = Color.Transparent;
            imageList1.Images.SetKeyName(0, "03.gif");
            imageList1.Images.SetKeyName(1, "6.gif");
            imageList1.Images.SetKeyName(2, "8.gif");
            imageList1.Images.SetKeyName(3, "09.gif");
            imageList1.Images.SetKeyName(4, "18.gif");
            imageList1.Images.SetKeyName(5, "24.gif");
            imageList1.Images.SetKeyName(6, "031.gif");
            // 
            // button1
            // 
            button1.BackColor = Color.Transparent;
            button1.FlatStyle = FlatStyle.Flat;
            button1.Image = Properties.Resources._6;
            button1.ImageAlign = ContentAlignment.MiddleLeft;
            button1.Location = new Point(65, 94);
            button1.Name = "button1";
            button1.Size = new Size(100, 48);
            button1.TabIndex = 0;
            button1.Text = "基本信息";
            button1.TextImageRelation = TextImageRelation.ImageBeforeText;
            button1.UseVisualStyleBackColor = false;
            button1.Click += Button1_Click;
            // 
            // button2
            // 
            button2.BackColor = Color.Transparent;
            button2.FlatStyle = FlatStyle.Flat;
            button2.Image = Properties.Resources._18;
            button2.Location = new Point(65, 166);
            button2.Name = "button2";
            button2.Size = new Size(100, 48);
            button2.TabIndex = 1;
            button2.Text = "信息查询";
            button2.TextImageRelation = TextImageRelation.ImageBeforeText;
            button2.UseVisualStyleBackColor = false;
            button2.Click += Button2_Click;
            // 
            // button3
            // 
            button3.BackColor = Color.Transparent;
            button3.FlatStyle = FlatStyle.Flat;
            button3.Image = Properties.Resources._6;
            button3.ImageAlign = ContentAlignment.MiddleLeft;
            button3.Location = new Point(65, 238);
            button3.Name = "button3";
            button3.Size = new Size(100, 48);
            button3.TabIndex = 2;
            button3.Text = "票号冲抵";
            button3.TextImageRelation = TextImageRelation.ImageBeforeText;
            button3.UseVisualStyleBackColor = false;
            button3.Click += Button3_Click;
            // 
            // button4
            // 
            button4.BackColor = Color.Transparent;
            button4.FlatStyle = FlatStyle.Flat;
            button4.ImageAlign = ContentAlignment.MiddleLeft;
            button4.ImageIndex = 5;
            button4.ImageList = imageList1;
            button4.Location = new Point(50, 94);
            button4.Name = "button4";
            button4.Size = new Size(100, 48);
            button4.TabIndex = 0;
            button4.Text = "供应商信息";
            button4.TextImageRelation = TextImageRelation.ImageBeforeText;
            button4.UseVisualStyleBackColor = false;
            button4.Visible = false;
            // 
            // button5
            // 
            button5.BackColor = Color.Transparent;
            button5.FlatStyle = FlatStyle.Flat;
            button5.ImageAlign = ContentAlignment.MiddleLeft;
            button5.ImageIndex = 2;
            button5.ImageList = imageList1;
            button5.Location = new Point(162, 94);
            button5.Name = "button5";
            button5.Size = new Size(100, 48);
            button5.TabIndex = 1;
            button5.Text = "零件信息";
            button5.TextImageRelation = TextImageRelation.ImageBeforeText;
            button5.UseVisualStyleBackColor = false;
            button5.Visible = false;
            // 
            // button6
            // 
            button6.BackColor = Color.Transparent;
            button6.FlatStyle = FlatStyle.Flat;
            button6.ImageIndex = 3;
            button6.ImageList = imageList1;
            button6.Location = new Point(274, 94);
            button6.Name = "button6";
            button6.Size = new Size(100, 48);
            button6.TabIndex = 2;
            button6.Text = "职务信息";
            button6.TextImageRelation = TextImageRelation.ImageBeforeText;
            button6.UseVisualStyleBackColor = false;
            button6.Visible = false;
            // 
            // button7
            // 
            button7.BackColor = Color.Transparent;
            button7.FlatStyle = FlatStyle.Flat;
            button7.ImageAlign = ContentAlignment.MiddleLeft;
            button7.ImageIndex = 5;
            button7.ImageList = imageList1;
            button7.Location = new Point(50, 166);
            button7.Name = "button7";
            button7.Size = new Size(100, 48);
            button7.TabIndex = 3;
            button7.Text = "结款查询";
            button7.TextImageRelation = TextImageRelation.ImageBeforeText;
            button7.UseVisualStyleBackColor = false;
            button7.Visible = false;
            // 
            // button8
            // 
            button8.BackColor = Color.Transparent;
            button8.FlatStyle = FlatStyle.Flat;
            button8.ImageAlign = ContentAlignment.MiddleLeft;
            button8.ImageIndex = 2;
            button8.ImageList = imageList1;
            button8.Location = new Point(162, 166);
            button8.Name = "button8";
            button8.Size = new Size(100, 48);
            button8.TabIndex = 4;
            button8.Text = "库存查询";
            button8.UseVisualStyleBackColor = false;
            button8.Visible = false;
            // 
            // button9
            // 
            button9.BackColor = Color.Transparent;
            button9.FlatStyle = FlatStyle.Flat;
            button9.ImageAlign = ContentAlignment.MiddleLeft;
            button9.Location = new Point(274, 166);
            button9.Name = "button9";
            button9.Size = new Size(100, 48);
            button9.TabIndex = 5;
            button9.Text = "报损查询";
            button9.TextImageRelation = TextImageRelation.ImageBeforeText;
            button9.UseVisualStyleBackColor = false;
            button9.Visible = false;
            // 
            // button10
            // 
            button10.BackColor = Color.Transparent;
            button10.FlatStyle = FlatStyle.Flat;
            button10.ImageIndex = 5;
            button10.ImageList = imageList1;
            button10.Location = new Point(50, 238);
            button10.Name = "button10";
            button10.Size = new Size(100, 48);
            button10.TabIndex = 6;
            button10.Text = "入库冲销";
            button10.TextImageRelation = TextImageRelation.ImageBeforeText;
            button10.UseVisualStyleBackColor = false;
            button10.Visible = false;
            // 
            // button11
            // 
            button11.BackColor = Color.Transparent;
            button11.FlatStyle = FlatStyle.Flat;
            button11.ImageAlign = ContentAlignment.MiddleLeft;
            button11.ImageIndex = 2;
            button11.ImageList = imageList1;
            button11.Location = new Point(162, 239);
            button11.Name = "button11";
            button11.Size = new Size(100, 48);
            button11.TabIndex = 7;
            button11.Text = "出库冲抵";
            button11.TextImageRelation = TextImageRelation.ImageBeforeText;
            button11.UseVisualStyleBackColor = false;
            button11.Visible = false;
            // 
            // button12
            // 
            button12.BackColor = Color.Transparent;
            button12.FlatStyle = FlatStyle.Flat;
            button12.ImageIndex = 3;
            button12.ImageList = imageList1;
            button12.Location = new Point(274, 239);
            button12.Name = "button12";
            button12.Size = new Size(100, 48);
            button12.TabIndex = 8;
            button12.Text = "报损冲抵";
            button12.TextImageRelation = TextImageRelation.ImageBeforeText;
            button12.UseVisualStyleBackColor = false;
            button12.Visible = false;
            // 
            // Form1
            // 
            AutoScaleDimensions = new SizeF(7F, 17F);
            AutoScaleMode = AutoScaleMode.Font;
            ClientSize = new Size(644, 446);
            Controls.Add(splitContainer1);
            Controls.Add(toolStrip1);
            Controls.Add(menuStrip1);
            Name = "Form1";
            StartPosition = FormStartPosition.CenterScreen;
            Text = "图形化的导航界面";
            menuStrip1.ResumeLayout(false);
            menuStrip1.PerformLayout();
            toolStrip1.ResumeLayout(false);
            toolStrip1.PerformLayout();
            splitContainer1.Panel1.ResumeLayout(false);
            splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
            splitContainer1.ResumeLayout(false);
            ResumeLayout(false);
            PerformLayout();
        }

        #endregion

        private MenuStrip menuStrip1;
        private ToolStripMenuItem toolStripMenuItem1;
        private ToolStripMenuItem toolStripMenuItem2;
        private ToolStripMenuItem toolStripMenuItem3;
        private ToolStripMenuItem toolStripMenuItem4;
        private ToolStripMenuItem toolStripMenuItem5;
        private ToolStrip toolStrip1;
        private ToolStripButton toolStripButton1;
        private ToolStripButton toolStripButton2;
        private ToolStripButton toolStripButton3;
        private SplitContainer splitContainer1;
        private ImageList imageList1;
        private Button button3;
        private Button button2;
        private Button button1;
        private Button button12;
        private Button button11;
        private Button button10;
        private Button button9;
        private Button button8;
        private Button button7;
        private Button button6;
        private Button button5;
        private Button button4;
    }
}

3、Form1.cs

namespace _177
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 基本信息
        /// </summary>
        private void Button1_Click(object sender, EventArgs e)
        {
            button4.Visible = true;//设置button4控件可见
            button5.Visible = true;//设置button5控件可见
            button6.Visible = true;//设置button6控件可见
        }

        /// <summary>
        /// 信息查询
        /// </summary>
        private void Button2_Click(object sender, EventArgs e)
        {
            button7.Visible = true;//设置button7控件可见
            button8.Visible = true;//设置button8控件可见
            button9.Visible = true;//设置button9控件可见
        }

        /// <summary>
        /// 票号冲抵
        /// </summary>
        private void Button3_Click(object sender, EventArgs e)
        {
            button10.Visible = true;//设置button10控件可见
            button11.Visible = true;//设置button11控件可见
            button12.Visible = true;//设置button12控件可见
        }
    }
}

4、运行结果

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1592761.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

NzN的数据结构--归并排序及计数排序

篇接上文&#xff0c;今天要学习的是归并排序以及非比较排序--计数排序。这么励志的日更博主&#xff0c;你怎么能不三连一下呢&#xff1f; 目录 一、归并排序 1. 递归实现 2. 非递归实现 3. 特性总结 二、非比较排序--计数排序 三、排序算法复杂度及稳定性分析 一、归并…

vue3+element plus图片预览点击按钮直接显示图片的预览形式

1 需求 直接上需求&#xff1a; 我想要直接点击下面这个“预览”按钮&#xff0c;然后呈现出预览图片的形式 ok&#xff0c;需求知道了&#xff0c;下面让我们来看看如何实现吧 ~ 2 实现 template部分 <el-buttontype"primary"size"small"click&qu…

DRF多表关联的序列化和反序列化

DRF多表关联的序列化和反序列化 目录 DRF多表关联的序列化和反序列化序列化定制字段source一对多的序列化 多表关联的序列化方式1&#xff1a;在表模型中定义方法方式2&#xff1a;定制返回格式SerializerMethodField方式3&#xff1a;子序列化 多表关联的反序列化反序列化保存…

Ubuntu 上配置静态IP地址

Ubuntu 上配置静态IP地址编辑网络配置文件配置静态IP地址应用配置更改 Ubuntu 上配置静态IP地址 在终端中&#xff0c;运行以下命令来编辑网络配置文件 编辑网络配置文件 sudo cat /etc/netplan/01-netcfg.yaml在编辑器中&#xff0c;找到用于您的网络接口的配置部分。例如…

使用阿里云试用Elasticsearch学习:创建仪表板pivot、搜索discover和仪表板dashboard

文档&#xff1a;https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-examples.html#example-clientips 在kibana左栏打开Transforms&#xff0c;并创建Transforms&#xff08;转换&#xff09; Management > Stack Management > Data > T…

【Qt】界面优化

目录 一、QSS 1.1 基本语法 1.2 QSS设置方法 1.2.1 指定控件样式设置 1.2.2 全局样式设置 1.2.3 从文件加载样式表 1.2.4 使用Qt Designer编辑样式 1.3 选择器 1.3.1 介绍 1.3.2 子控件选择器 1.3.3 伪类选择器 1.4 样式属性(盒模型) 1.5 代码示例(登录界面) 二、…

自动化测试之httprunner框架hook函数实操

本篇介绍httprunner中hook函数的使用&#xff0c;以及通过编程能力实现建设自动化测试更全面的场景覆盖 前置&#xff1a; 互联网时代让我们更快的学习到什么是Httprunner 正文&#xff1a; 经过上文了解到这个框架怎么使用之后&#xff0c;我们开始来探讨一下我们为什么要用…

SecureCRT通过USB-Servial ch340串口无法连接单片机

通过USB To TTL连线 STM32F103-PRO&#xff0c;烧制程序到单片机上&#xff0c;通过SecureCRT通过USB-Servial ch340串口无法链接RS232升USB转TTL连接正确 开发板连接正确 问题&#xff1a;SecureCRT串口连接没有反应 问题分析&#xff1a;1、检查ch340串口驱动 查看设备管…

海洋信息管理系统:守护蓝色星球,促进海洋经济新发展

海洋&#xff0c;覆盖地球表面超过七成的广阔水域&#xff0c;是生命之源&#xff0c;也是经济发展的重要空间。然而&#xff0c;随着人类活动的增加&#xff0c;海洋生态环境面临严峻挑战&#xff0c;海洋资源的可持续利用成为全球关注的焦点。在这样的背景下&#xff0c;构建…

openssl 如何从pfx格式证书 获取证书序列号信息

已知&#xff1a;一个个人证书文件 test.pfx 求&#xff1a;如何通过openssl查看其对应证书的序列号信息&#xff1f; 踩坑之&#xff1a;unable to load certificate! openssl x509 -in xxx.cert -noout -serial 命令可查看证书序列号&#xff0c;但是这个-in 的输入必须是私…

一步一步学习使用 MediaSource 实现动态媒体流

学习前的参考 为什么视频网站的视频链接地址是blob&#xff1f; - 掘金 MediaSource - Web API 接口参考 | MDN 在示例中前往下载源代码&#xff1a; netfix/demo/bufferWhenNeeded.html at gh-pages nickdesaulniers/netfix GitHub 下载 demo 目录&#xff0c;对 bufferW…

量子信息产业生态研究(一):关于《量子技术公司营销指南(2023)》的讨论

写在前面。量子行业媒体量子内参&#xff08;Quantum Insider&#xff09;编制的《量子技术公司营销指南》是一本实用的英文手册&#xff0c;它旨在帮助量子科技公司建立有效的营销策略&#xff0c;同时了解如何将自己定位成各自的行业专家。本文对这篇指南的主要内容进行了翻译…

C语言中的编译和链接

系列文章目录 文章目录 ​编辑 系列文章目录 文章目录 前言 一、 翻译环境和运行环境 二、 翻译环境 2.1 编译 2.1.1 预处理 2.1.2 编译 2.1.2.1 词法分析 : 2.1.2.2 语法分析 2.1.2.3 语义分析 2.1.3 汇编 2.2 链接 三、运行环境 前言 在我们平常的写代码时&#xff0c;我们很…

set 类 和 map 类

1. 关联式容器 关联式容器也是用来存储数据的&#xff0c;与序列式容器不同的是&#xff0c;其里面存储的是<key, value>结构的 键值对&#xff0c;在数据检索时比序列式容器效率更高 2. 键值对 用来表示具有一一对应关系的一种结构&#xff0c;该结构中一般只包含…

你的系统是如何跟MySQL打交道的

1、Java 工程师眼中的数据库是什么东西? 从今天开始&#xff0c;我们将要开始一个MySQL的专栏&#xff0c;一起来研究MySQL数据库的底层原理和各种实践案例&#xff0c;以及互联网公司的技术方案。 现在我们先来看看&#xff0c;在一个Java工程师眼中的数据库是什么东西? 平时…

开源 Ruo-Yi 项目引入 Mybatis-Plus:3.5.3 报错ClassNotFoundException:

开源 Ruo-Yi 项目引入 Mybatis-Plus:3.5.3 报错ClassNotFoundException&#xff1a; Caused by: java.lang.ClassNotFoundException: com.baomidou.mybatisplus.extension.plugins.MybatisPlusInter1 分析问题 控制台报错说明我们引入的 mybatis-plus 的依赖里找不到com.baom…

怎么恢复删除的回收站数据?分享多种恢复方法

在日常使用电脑的过程中&#xff0c;回收站是我们经常打交道的一个功能。它帮助我们管理不再需要的文件&#xff0c;但有时候&#xff0c;我们可能会不小心删除了重要文件&#xff0c;或者误清空了回收站。那么&#xff0c;面对这种情况&#xff0c;我们该如何恢复删除的回收站…

小程序面试题之性能优化提高10道

1.你使用过哪些方法&#xff0c;来提高微信小程序的应用速度&#xff1f; 提高页面加载速度 用户行为预测 减少默认data的大小 组件化方案 控制包的大小 压缩代码&#xff0c;清理无用代码 采用分包策略 启用本地缓存 参考地址&#xff1a;https://blog.csdn.net/wu_xianqiang/…

Linux上的可执行文件在Windows上是不能运行的

一、概要 1、可执行文件的格式 Linux上的可执行文件是elf格式的 Windows上的可执行文件是exe格式的 Linux上的可执行文件在Windows上是不能运行的 2、程序的普通构建与静态构建 普通构建&#xff1a; 一个.c文件&#xff0c;用gcc命令编译成可执行文件(程序)&#xff0c…

数据结构排序篇上

排序的概念及其运用 排序的概念 排序 &#xff1a;所谓排序&#xff0c;就是使一串记录&#xff0c;按照其中的某个或某些关键字的大小&#xff0c;递增或递减的排列起来的操作。 稳定性 &#xff1a;假定在待排序的记录序列中&#xff0c;存在多个具有相同的关键字的记录&…