当前位置: 首页>>代码示例>>C#>>正文


C# TabPage类代码示例

本文整理汇总了C#中TabPage的典型用法代码示例。如果您正苦于以下问题:C# TabPage类的具体用法?C# TabPage怎么用?C# TabPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TabPage类属于命名空间,在下文中一共展示了TabPage类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InstructionsForm

	public InstructionsForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _bugDescriptionText1
		// 
		_bugDescriptionText1 = new TextBox ();
		_bugDescriptionText1.Multiline = true;
		_bugDescriptionText1.Location = new Point (8, 8);
		_bugDescriptionText1.Dock = DockStyle.Fill;
		_bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture,
			"Expected result on start-up:{0}{0}" +
			"1. The background color of the Form is blue and does not show " +
			"any distortions.",
			Environment.NewLine);
		// 
		// _tabPage1
		// 
		_tabPage1 = new TabPage ();
		_tabPage1.Text = "#1";
		_tabPage1.Controls.Add (_bugDescriptionText1);
		_tabControl.Controls.Add (_tabPage1);
		// 
		// InstructionsForm
		// 
		ClientSize = new Size (330, 120);
		Location = new Point (600, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "Instructions - bug #81721";
	}
开发者ID:mono,项目名称:gert,代码行数:35,代码来源:MainForm.cs

示例2: DrawTab

		protected override int DrawTab (Graphics dc, TabPage page, TabControl tab, Rectangle bounds, bool is_selected)
		{
			if (!ShouldPaint (tab))
				return base.DrawTab (dc, page, tab, bounds, is_selected);
			VisualStyleElement element = GetVisualStyleElement (tab, page, is_selected);
			if (!VisualStyleRenderer.IsElementDefined (element))
				return base.DrawTab (dc, page, tab, bounds, is_selected);
			new VisualStyleRenderer (element).DrawBackground (dc, bounds);
			bounds.Inflate (
				-(tab.Padding.X),
				-(tab.Padding.Y));
			Rectangle text_area = bounds;
			if (tab.ImageList != null && page.ImageIndex >= 0 && page.ImageIndex < tab.ImageList.Images.Count) {
				int image_y = bounds.Y + (bounds.Height - tab.ImageList.ImageSize.Height) / 2;
				tab.ImageList.Draw (dc, new Point (bounds.X, image_y), page.ImageIndex);
				int image_occupied_space = tab.ImageList.ImageSize.Width + 2;
				text_area.X += image_occupied_space;
				text_area.Width -= image_occupied_space;
			}
			if (page.Text != null)
				dc.DrawString (page.Text, tab.Font, SystemBrushes.ControlText, text_area, DefaultFormatting);
			if (tab.Focused && is_selected && tab.ShowFocusCues)
				ControlPaint.DrawFocusRectangle (dc, bounds);
			return 0;
		}
开发者ID:KonajuGames,项目名称:SharpLang,代码行数:25,代码来源:TabControlPainter.cs

示例3: MainForm

	public MainForm ()
	{
		// 
		// _tabControl
		// 
		_tabControl = new TabControl ();
		_tabControl.Dock = DockStyle.Fill;
		Controls.Add (_tabControl);
		// 
		// _tabGeneral
		// 
		_tabGeneral = new TabPage ();
		_tabGeneral.TabIndex = 0;
		_tabGeneral.Text = "General";
		_tabControl.Controls.Add (_tabGeneral);
		// 
		// _tabAlerts
		// 
		_tabAlerts = new TabPage ();
		_tabAlerts.TabIndex = 1;
		_tabAlerts.Text = "Alerts";
		_tabControl.Controls.Add (_tabAlerts);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 100);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82229";
		Load += new EventHandler (MainForm_Load);
	}
开发者ID:mono,项目名称:gert,代码行数:31,代码来源:MainForm.cs

示例4: main_form_loaded

    public void main_form_loaded()
    {
        TabControl TabCtrl = (TabControl)GetControl("tabZoneProperties");
        tabWeather = new TabPage("Weather");
        tabWeather.UseVisualStyleBackColor = true;
        TabCtrl.TabPages.Add(tabWeather);

        MainForm.Controls.Remove(TabCtrl);

        lblRain = new Label();
        lblRain.Text = "Rain Type";

        string[] types =  {"RAIN_NONE", "RAIN_OUTSIDE", "RAIN_OUTSIDE_DESERT",
                  "RAIN_BUILDING", "RAIN_BUILDING_TOP", "RAIN_BUILDING_BOTTOM",
                  "RAIN_CAVE", "RAIN_MINE", "RAIN_COAST", "RAIN_SEA" };

        cmbRain = new ComboBox();
        cmbRain.DropDownStyle = ComboBoxStyle.DropDownList;
        cmbRain.DropDownWidth = 200;
        cmbRain.Items.AddRange(types);
        cmbRain.SelectedIndex = -1;

        tabWeather.Controls.Add(cmbRain);
        tabWeather.Controls.Add(lblRain);

        lblRain.Location = new System.Drawing.Point(7, 10);
        cmbRain.Location = new System.Drawing.Point(65, 7);

        Load();
    }
开发者ID:Gargash,项目名称:fo2238,代码行数:30,代码来源:weather.cs


注:本文中的TabPage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。