tabcontrol

Using one datagridview across multiple tabs in tabcontrol

坚强是说给别人听的谎言 提交于 2019-12-22 18:44:16
问题 I have a datagridview (datagridview1) on TabPage1 of TabControl1 which is one my 'Records' form. Currently I populate the datagridview with a loop that executes on the page load event and loads the data in from an excel file that it is an included resource. In the loop I also have tabs created and named for each sheet and sheet name that the excel file has. The two sheets I have in the excel file current are name "2012" and "2013". the first tab in the TabControl is named "2013" and the

Visual Studio is falling apart on me?

拜拜、爱过 提交于 2019-12-22 17:58:56
问题 I have a problem that I hope can be fixed. I have been working on a project in VS 2010 - and it seems things are falling apart faster than I can fix them. I have not changed how I am coding or using the designer from the previous months... Here are some screen shots - perhaps someone can help me figure out what's going on here? I know this is rather vague - but I'm pulling my hair out, and maybe someone else has been in this boat! These are from the TabControl craping out on me, an things are

TabControl's SelectionChanged event issue

﹥>﹥吖頭↗ 提交于 2019-12-22 12:02:30
问题 I am working on WPF and I am creating a userControl which contains a TabControl which has some TabItems. I need to execute some stuff when the selected tab changes, so, what I tried to do is to use the event myTabControl.SelectionChanged but it was raised many times, even though I only clicked once a TabItem. Then I read this post is-there-selected-tab-changed-event-in-the-standard-wpf-tab-control and put this code inside my method: void mainTabControl_SelectionChanged(object sender,

TabControl's SelectionChanged event issue

孤街浪徒 提交于 2019-12-22 12:02:19
问题 I am working on WPF and I am creating a userControl which contains a TabControl which has some TabItems. I need to execute some stuff when the selected tab changes, so, what I tried to do is to use the event myTabControl.SelectionChanged but it was raised many times, even though I only clicked once a TabItem. Then I read this post is-there-selected-tab-changed-event-in-the-standard-wpf-tab-control and put this code inside my method: void mainTabControl_SelectionChanged(object sender,

Doubleclicking tab control header

折月煮酒 提交于 2019-12-22 10:53:56
问题 I've been wondering about this problem for some time - doubleclicking a winforms TabControl's header doesn't get detected, but I'd like to handle this event. It looks like all mouse events (click,move,etc.) don't get raised when they are on the 'inactive' area of TabControl. I've even tried subclassing TabControl, but the derived class' events aren't raised too. Overriding WndProc shown that it doesn't receive WM_LBUTTONDBLCLK message (I mean - WTF?). Thanks. But I'm sure that the tab control

How to save WPF UI state?

情到浓时终转凉″ 提交于 2019-12-22 08:27:15
问题 I have a TabControl and under it I have several elements like TreeView and DataGrid . When I expand the tree and resize data grid columns, if I then tab to another tab and come back, the entire UI state is forgotten. I have to re-expand the tree and resize the columns. Is there a sensible and existing way to save the UI state? Let's divide this into - temporary (in memory) and permanent (on the disk). 回答1: To save the state you can bind the relevant control( Width , Height , IsSelected etc.)

Loop through controls in TabControl

情到浓时终转凉″ 提交于 2019-12-22 08:18:18
问题 I am looking for a way to loop through controls on a particular tab of a tabcontrol. For example, I have a tabcontrol with the following tabs: Cars, Pets, Admin On each of these tabs are several controls to display/edit/save data, etc. On the "Save" button, I would like to loop through the controls for that particular tab to check whether all required fields have been filled in. So, if I am on the Cars tab and click "Save," I want to loop ONLY through the controls on the Cars tab and NOT the

TabControl- preventing user from changing the selected tab: MessageBox causing bug

こ雲淡風輕ζ 提交于 2019-12-22 06:10:38
问题 I've been pounding away at this issue for a little while, and have only found part of the solution. I'm trying to set up a TabControl so that I can in some cases prevent the user from changing the currently selected tab. When the user is prevented from changing the currently selected tab, then they are shown a dialog box. I have already read the following documents: WPF - reset ListBox scroll position when ItemsSource changes http://wizardsofsmart.net/uncategorized/itemssourcechanged-event

Show SelectedIndex in WPF Tabcontrol header template

半城伤御伤魂 提交于 2019-12-21 17:08:36
问题 I have 1...n tabcontrols in my application, with the following XAML setup: <TabControl Name="ordersTabControl" ItemsSource="{Binding CoilItems}"> <TabControl.ItemTemplate> <DataTemplate DataType="models:Coil"> <StackPanel> <TextBlock Text="{Binding CoilCode, StringFormat='Coil: {0}'}" /> <TextBlock Text="{Binding ArticleCode, StringFormat='Auftrag: {0}'}" /> <TextBlock Text="{Binding RestWeight, StringFormat='Restgewicht: {0} kg'}" /> </StackPanel> </DataTemplate> </TabControl.ItemTemplate>

Enable a TabItem via Binding

核能气质少年 提交于 2019-12-21 03:55:10
问题 I want to use MVVM in an application where the different pages are TabItems. For this I use an observable collection of my view models (Items) and bind it to the tabcontrols ItemSource. For each view model, I created an individual data template to render the correct view like this: <DataTemplate DataType="{x:Type baseVm:AViewModel}"> <baseVw:AView /> </DataTemplate> To display the correct name in the tab's header I created another data template to be applied to each of the tab control's