tabcontrol

TabControl and borders visual glitch

旧巷老猫 提交于 2019-11-27 13:17:28
I have these visual glitches on every tabControls when I am changing its tabPages BackColor and the BackColor of the form, as illustrated on the following images: At the top of the tabPage , there is an interior one-pixel white border. At the left of the tabPage , there is an interior three-pixels white border. At the bottom of the tabPage , there is an interior one-pixel white border and an exterior two-pixels white border. At the right of the tabPage , there is an interior one-pixel white border and an exterior two-pixels white border. Is there a way I can get rid of those white borders?

Check if a specific tab page is selected (active)

Deadly 提交于 2019-11-27 12:38:48
问题 I am making an event to check if specific tab page in a tab control is active. The point is, it will trigger an event if that tab page in a tab control is the currently selected tab. Any code that will give me what I need? 回答1: Assuming you are looking out in Winform, there is a SelectedIndexChanged event for the tab Now in it you could check for your specific tab and proceed with the logic private void tab1_SelectedIndexChanged(object sender, EventArgs e) { if (tab1.SelectedTab == tab1

TabControl with Add New Tab Button (+)

霸气de小男生 提交于 2019-11-27 11:06:42
What is the proper way of adding a '+' button tab at the end of all the tab items in the tab strip of a tab control in WPF? It should work correctly with multiple tab header rows. It should be at the end of all tab items Tab cycling should work correctly ( Alt + Tab ), that is, the + tab should be skipped. I shouldn't have to modify the source collection I am binding to. That is, the control should be reusable. The solution should work with MVVM To be more precise, the button should appear exactly as an additional last tab and not as a separate button somewhere on the right of all tab strip

How to add and remove “custom” tabs in C#

烂漫一生 提交于 2019-11-27 07:30:06
问题 I am making an application that requires tabs (tab-control) to be added or removed. I have done the add and remove for tabs fine, but I have custom buttons instead of using the tabs. (This button will go the the first tab page when clicked): //This will make it go to TAB 1 private void button1_Click(object sender, EventArgs e) { tabControl1.SelectedIndex = 0; } //This will change the MOUSEENTER to the correct image private void button1_MouseEnter(object sender, EventArgs e) { button1

Change SelectedTab of TabControl on MouseOver

*爱你&永不变心* 提交于 2019-11-27 07:22:54
问题 I have a Windows Forms project with a TabControl . Does anyone know how to change the SelectedTab when you hover over it with the pointer? 回答1: You can use TabControl's MouseMove event to detect whether your mouse is present on any tab and then can select it: private void tabControl1_MouseMove(object sender, MouseEventArgs e) { Rectangle mouseRect = new Rectangle(e.X, e.Y, 1, 1); for (int i = 0; i < tabControl1.TabCount; i++) { if (tabControl1.GetTabRect(i).IntersectsWith(mouseRect)) {

Is there Selected Tab Changed Event in the standard WPF Tab Control

拜拜、爱过 提交于 2019-11-27 07:02:00
In WPF, is there an event that can be used to determine when a TabControl 's selected tab changes? I have tried using TabControl.SelectionChanged but it is getting fired many times when a child's selection within a tab is changed. I tied this in the handler to make it work: void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (e.Source is TabControl) { //do work when tab is changed } } unexpectedkas If you set the x:Name property to each TabItem as: <TabControl x:Name="MyTab" SelectionChanged="TabControl_SelectionChanged"> <TabItem x:Name="MyTabItem1" Header="One"/

How to get current tab index in Flutter

倾然丶 夕夏残阳落幕 提交于 2019-11-27 06:53:24
问题 In flutter implementing a tab layout is easy and straightforward. This is a simple example from the official documentation: import 'package:flutter/material.dart'; void main() { runApp(new TabBarDemo()); } class TabBarDemo extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( home: new DefaultTabController( length: 3, child: new Scaffold( appBar: new AppBar( bottom: new TabBar( tabs: [ new Tab(icon: new Icon(Icons.directions_car)), new Tab(icon: new

Icons in TabControl C# - How?

时间秒杀一切 提交于 2019-11-27 06:52:34
问题 I can't seem to find an answer for this anywhere. An icon before the label on the default tabcontrol tabs would suffice for my needs. Thanks in advance. Q: You need to clarify what library set you're using: Winforms, WPF, ASP.Net, GTK#, etc. – Nathan Ernst A: You are totally right, my mistake. I'm using Winforms. I switched back from WPF, since WPF was crashing in some computers. 回答1: It is a built-in feature of the TabControl. Drop an ImageList on the form and fill it with your icons. Set

Strange issue with a datagridview and a tabcontrol C#

妖精的绣舞 提交于 2019-11-27 06:32:56
问题 I have a strange problem. I have a TabControl with two TabPages . Each page has a datagridview . Both datagridviews are populated with XML files. I want to have the AutoSizeColumnsMode set to " Fill " for both DataGridViews . I want to set the width of columns in my code. And everything works fine for the TabPage1 but setting width for the DataGridView on TabPage2 throws the NullReferenceException . I really don't get it because I do the same thing as for datagridview1 and there works fine

How to create trapezoid tabs in WPF tab control

给你一囗甜甜゛ 提交于 2019-11-27 05:51:22
How to create trapezoid tabs in WPF tab control? I'd like to create non rectangular tabs that look like tabs in Google Chrome or like tabs in code editor of VS 2008. Can it be done with WPF styles or it must be drawn in code? Is there any example of code available on internet? Edit: There is lots of examples that show how to round corners or change colors of tabs, but I could not find any that changes geometry of tab like this two examples: VS 2008 Code Editor Tabs Google Chrome tabs Tabs in this two examples are not rectangles, but trapezes. rooks I tried to find some control templates or