以选项卡方式显示窗体和图片,C#源代码
以选项卡方式显示窗体和图片,C#源代码 //以选项卡方式显示窗体 this.tabControl1.ShowToolTips = true; this.tabControl1.Dock = DockStyle.Fill; this.tabPage1.Text = "第一幅图像"; this.tabPage1.BackgroundImage = System.Drawing.Image.FromFile("MyBmp1.bmp"); this.tabPage1.ToolTipText = "显示第一幅图像"; this.tabPage1.ImageIndex = 0; this.tabPage1.BorderStyle = BorderStyle.Fixed3D; this.tabPage2.Text = "第二幅图像"; this.tabPage2.Backgr oundImage = System.Drawing.Image.FromFile("MyBmp2.bmp"); this.tabPage2.ToolTipText = "显示第二幅图像"; this.tabPage2.ImageIndex = 1; this.tabPage2.BorderStyle = BorderStyle.Fixed3D; this.tabPage3.Text = "第三幅图像"; this.tabPage3.BackgroundImage = System.Drawing.Image.FromFile("MyBmp3.bmp"); this.tabPage3.ToolTipText = "显示第三幅图像"; this.tabPage3.ImageIndex = 2; this.tabPage3.BorderStyle = BorderStyle.Fixed3D; this.tabPage4.Text = "第四幅图像"; this.tabPage4.BackgroundImage = System.Drawing.Image.FromFile("MyBmp4.bmp"); this.tabPage4.ToolTipText = "显示第四幅图像"; this.tabPage4.ImageIndex = 3; this.tabPage4.BorderStyle = BorderStyle.Fixed3D; oundImage = System.Drawing.Image.FromFile("MyBmp2.bmp"); this.tabPage2.ToolTipText = "显示第二幅图像"; this.tabPage2.ImageIndex = 1; this.tabPage2.BorderStyle = BorderStyle.Fixed3D; this.tabPage3.Text = "第三幅图像"; this.tabPage3.BackgroundImage = System.Drawing.Image.FromFile("MyBmp3.bmp"); this.tabPage3.ToolTipText = "显示第三幅图像"; this.tabPage3.ImageIndex = 2; this.tabPage3.BorderStyle = BorderStyle.Fixed3D; this.tabPage4.Text = "第四幅图像"; this.tabPage4.BackgroundImage = System.Drawing.Image.FromFile("MyBmp4.bmp"); this.tabPage4.ToolTipText = "显示第四幅图像"; this.tabPage4.ImageIndex = 3; this.tabPage4.BorderStyle = BorderStyle.Fixed3D;
用户评论
没有选中的选卡不能隐藏关闭按钮 若是可以实现就好了
相当的不错,我又学到了新的东西。
不太适用,我做开发应该软件使用