tabcontrol

Winforms - How to create new tab and TabPage from current form to MainWindow form

戏子无情 提交于 2020-01-17 10:02:10
问题 I have a MainWindow form which contains TabControl component where dynamicly on click on menuItem I create a new tab and TabPage . The new created TabPage contains a new Form . The new opened TabPage , which contains the new Form en. Products have DataGridView with products list. When I double click on a cell in the DataGridview from Products form I want to open new tabPage to Mainwindow . dataGridView1_CellContentDoubleClick -> open new tab in main window In MainWindow I create: private void

Winforms - How to create new tab and TabPage from current form to MainWindow form

有些话、适合烂在心里 提交于 2020-01-17 10:01:16
问题 I have a MainWindow form which contains TabControl component where dynamicly on click on menuItem I create a new tab and TabPage . The new created TabPage contains a new Form . The new opened TabPage , which contains the new Form en. Products have DataGridView with products list. When I double click on a cell in the DataGridview from Products form I want to open new tabPage to Mainwindow . dataGridView1_CellContentDoubleClick -> open new tab in main window In MainWindow I create: private void

Custom TabItem in TabControl

笑着哭i 提交于 2020-01-17 01:09:10
问题 I've created CustomTabItem which inherits from TabItem and i'd like to use it while binding ObservableCollection in TabControl <TabControl ItemsSource="{Binding MyObservableCollection}"/> It should like this in XAML, but i do not know how change default type of the output item created by TabControl while binding. I've tried to create converter, but it has to do something like this inside convertin method: List<CustomTabItem> resultList = new List<CustomTabItem>(); And iterate through my input

Add a right click event to a tab in a TabControl container

冷暖自知 提交于 2020-01-16 08:52:21
问题 In a form I have a tab container in which I dynamically add tabs through the use of a button. As there is no easy way that I know of (then again I'm a WinForms newbie) to close the selected tab, I'd like to set up an event handler for handling a right click through which the tab will close. In simple words I want to right-click on the selected tab in order to close it. This is the event handler which I have written (yet doesn't work): private void tab_Click(object sender, EventArgs e) {

How to implement a close button on every tab of TTabControl in Delphi XE3 FireMonkey 2?

醉酒当歌 提交于 2020-01-15 11:39:11
问题 I am trying to create a browser-style TabControl with a small close button on every tab in FireMonkey FM2. Since there are no TTabsheet and TPageControl components in FM2, I could not use the answer from "How to implement a close button for a TTabsheet of a TPageControl". This code gives too many undeclared functions and variables that are not longer supported in FM2, I guess. I don't want to use any third-part components because you never know if they are going to support the next version of

How to use a CTabCtrl in a MFC dialog based application?

混江龙づ霸主 提交于 2020-01-14 14:58:05
问题 I need to do something which i expected to be was simple - create a tab control which has 2 tabs, implying 2 modes of operation for my app. When user clicks on Tab1, he'll be presented with some buttons and textboxes, and when he clicks Tab2, some other input method. I noticed that there was a CTabCtrl class thats used in MFC to add tabs. However, once I added the tab ctrl using the UI designer, I couldn't specify how many tabs there'll be using property window. Searching on the net, I found

Xaml TabControl in the top of window

烈酒焚心 提交于 2020-01-14 04:53:22
问题 Hi All! I have a trouble with xaml-markup design that is shown on a picture. How to place window buttons in one line with tab item headers TAB1 , TAB2 , TAB3 ? I use custom control for window buttons like: <Border> <StackPanel Orientation="Horizontal"> ... buttons ... </StackPanel> </Border> Does anyone have ideas how I can implement this? 回答1: You will probably have to remove the window border and draw the buttons yourself. You'll have to handle button clicks yourself (don't forget that

Xaml TabControl in the top of window

落花浮王杯 提交于 2020-01-14 04:53:07
问题 Hi All! I have a trouble with xaml-markup design that is shown on a picture. How to place window buttons in one line with tab item headers TAB1 , TAB2 , TAB3 ? I use custom control for window buttons like: <Border> <StackPanel Orientation="Horizontal"> ... buttons ... </StackPanel> </Border> Does anyone have ideas how I can implement this? 回答1: You will probably have to remove the window border and draw the buttons yourself. You'll have to handle button clicks yourself (don't forget that

How to cancel tab change in WPF TabControl

旧街凉风 提交于 2020-01-13 18:11:26
问题 I have found multiple questions about this problem on SO, however I still can't quite get a realiable solution. Here is what I came up with after reading the answers. Xaml: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="300" Width="300" x:Name="this"> <TabControl IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Tabs, ElementName=this}" x

WinForms TabControl validation: Switch to a tab where validation failed

会有一股神秘感。 提交于 2020-01-13 04:47:21
问题 I currently have a Form with a TabControl containing some TabPage s. Each TabPage has several controls with validation logic and appropriate ErrorProvider s. On my OK_Button_Clicked event, I call Form.ValidateChildren() in order to determine whether to save and close the form . Now, suppose I have a control in tab 1 that fails validation, but the currently visible tab is tab 2. When the user presses OK, he would get no visual indication as to why the form is not closing. I would like to be