您的问题似乎不完整,您是想询问关于C语言编程的某个具体问题吗?比如C语言的语法、编程技巧、项目开发等。请提供更具体的信息,这样我才能给出更准确的回答。

摘要:本文关键字: 多窗口切换 label splitContainer 窗口背景颜色设置 字体设置 窗口布局 按钮事件 按钮 新建项目: 开发MainForm: MainForm先添加1个splitContainer,然后splitContai
本文关键字: 多窗口切换 label splitContainer 窗口背景颜色设置 字体设置 窗口布局 按钮事件 按钮 新建项目: 开发MainForm: MainForm先添加1个splitContainer,然后splitContainer.Panel1添加3个按钮,分别是button1,button2,button3 这里设置splitContainer的左侧panel1固定大小, splitContainer1.IsSplitterFixed = false; // IsSpliterFixed属性设为False splitContainer1.FixedPanel = FixedPanel.Panel1; //FixedPannel属性设为Pannel1(要固定的面板的名称) 再右键项目名称添加一个Form1: Form1设计界面添加2个label控件,分别命名为lbTitle,lbContent; 控件设置为文本居中,大小固定; 在Form1的构造函数修改为传入3个参数,分别为Title,Conten和背景色color Form1的完整代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace 多窗口切换的实现 { public partial class Form1 : Form { public Form1(string title,string content ,Color color) { InitializeComponent( ); lbTitle.Text = title; lbContent.Text = content; this.BackColor = color; lbTitle.Font=new Font("仿宋", 20, FontStyle.Regular); //第一个是字体,第二个大小,第三个是样式 lbContent.Font = new Font("仿宋", 20, FontStyle.Regular); //第一个是字体,第二个大小,第三个是样式 } } } MainForm的完整代码: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace 多窗口切换的实现 { public partial class MainForm : Form { //在主窗体初始化3个Form1窗体 public Form f1; public Form f2; public Form f3; public MainForm( ) { InitializeComponent( ); splitContainer1.IsSplitterFixed = false; // IsSpliterFixed属性设为False splitContainer1.FixedPanel = FixedPanel.Panel1; //FixedPannel属性设为Pannel1(要固定的面板的名称) } private void MainForm_Load( object sender, EventArgs e ) { string title = "窗口一"; string content = "北国风光,千里冰封。"; Color color = Color.FromArgb(255, 192, 255); //此方法设置的颜色,其透明度属性alpha=255,完全不透明。 f1 = new Form1(title, content,color); f1.Dock = System.Windows.Forms.DockStyle.Fill; f1.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; f1.TopLevel = false; title = "窗口二"; content = "成吉思汗,只识弯弓射大雕。"; color = Color.FromArgb(205, 255, 205); //此方法设置的颜色,其透明度属性alpha=255,完全不透明。 f2 = new Form1(title, content,color); f2.Dock = System.Windows.Forms.DockStyle.Fill; f2.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; f2.TopLevel = false; title = "窗口三"; content = "俱往矣,数风流人物还看今朝。"; color = Color.FromArgb(155, 152, 255); //此方法设置的颜色,其透明度属性alpha=255,完全不透明。 f3 = new Form1(title, content,color); f3.Dock = System.Windows.Forms.DockStyle.Fill; f3.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; f3.TopLevel = false; //———————————————— // 版权声明:本文为博主原创文章,遵循 CC 4.0 BY - SA 版权协议,转载请附上原文出处链接和本声明。 //