tabcontrol

How can C# WebBrowser reduce the memory occupying/How to solve WebBrowser's memory leak?

纵饮孤独 提交于 2021-02-11 17:00:23
问题 I'm using WebBrowser to write a program (let's call it < tinyWb >) to do some automatic web form filling jobs, etc., just for fun. < tinyWb > mainly does the following jobs: open a tabPage, navagate to a URL, do some business, and then close the tab. There are about 25 URLs total that need to be navigated to, but I found that the memory that the < tinyWb > program is occupying is growing continuously, and after about 10 hours it will require about 120m physical memory and about 240m virtual

Configuring dynamic headers for a WPF TabControl

牧云@^-^@ 提交于 2021-02-11 14:00:36
问题 I am trying to make a basic window that uses a WPF TabControl to allow users to add new tabs. I want the end product to look somewhat like the way tabs work in a web browser where the last tab is just a "+" that when clicked it will add a new tab. I am trying to write the XAML code to set this up and I found that I can specify multiple DataTemplates within "TabControl.Resources" and based on the "DataType" the correct DataTemplate will be used to display the correct view for each tab... but

TabControl becoming very laggy

社会主义新天地 提交于 2021-02-11 12:48:58
问题 We're using a Tabcontrol to display a number of items with rather expensive content, and the issue we're having is that as you iterate over the tabs (selecting them one by one), the responsiveness of the application becomes slower and slower. This behavior is unexpected as from what I understand, as the selected tab changes, the previously selected tabs content is unloaded first, so that you're only paying the price for one tabs content at a time. I've managed to simulate the behaviour with

WPF TabControl no selected Item on start

情到浓时终转凉″ 提交于 2021-02-11 02:01:07
问题 I am using a WPF tabcontrol to display items which are bound from a viewmodel. By default on start the first item of the list is selected but I want no item to be selected on start. I can set the SelectedItem in the OnSelectionChanged event to null then no item is selected on start but then it is no longer possible to manually select a item. public partial class ProjectScopeMain : Window { private bool firstStart = true; public ProjectScopeMain() { this.Initialized += this.ProjectScopeMain

WPF TabControl no selected Item on start

╄→尐↘猪︶ㄣ 提交于 2021-02-11 01:58:00
问题 I am using a WPF tabcontrol to display items which are bound from a viewmodel. By default on start the first item of the list is selected but I want no item to be selected on start. I can set the SelectedItem in the OnSelectionChanged event to null then no item is selected on start but then it is no longer possible to manually select a item. public partial class ProjectScopeMain : Window { private bool firstStart = true; public ProjectScopeMain() { this.Initialized += this.ProjectScopeMain

How to get the user input from the frame and save into txt file?

烈酒焚心 提交于 2021-02-05 12:32:02
问题 My programs run like this: I have a form with an add button, save button, and tabcontrol. When the add button in the form is clicked, the tabcontrol will add more tabitem. And the tabitem is basically added from myframe which includes users key-in value in a TEdit. What I want to achieve is to print all the user input from the frame to a txt file when I click on the save button(tick) in the form. This is my code in form. Can anyone please give me some hint? My frame Image: My form Image: My

Confirmation on switching between tabs

倖福魔咒の 提交于 2021-01-28 05:40:49
问题 I have two tabitems. User will enter some data and save it on the first tab. The second tab lists the saved data. What I need is when the user select the second tab before saving data in first tab a confirmation message box with Yes, No and Cancel should be shown. If the user clicks Yes button the data should be saved and go to the second tab. If he hits No, the data need not to be saved and finally if Cancel is hit the tab will retain with all entered data. How can i make this? 回答1: To keep

WPF SelectedIndex set issue of TabControl

大憨熊 提交于 2021-01-28 02:42:32
问题 I have a TabControl with two items. <TabControl x:Name="tab" SelectionChanged="TabControl_SelectionChanged"> <TabItem Header="TabItem1"> <Grid /> </TabItem> <TabItem Header="TabItem2"> <Grid /> </TabItem> </TabControl> private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { Debug.WriteLine("Selected Index: " + tab.SelectedIndex); if (tab.SelectedIndex == 1) { tab.SelectedIndex = 0; } } when click 2nd item, 1st item have focus and print below. Selected Index: 1

WPF SelectedIndex set issue of TabControl

会有一股神秘感。 提交于 2021-01-27 23:14:41
问题 I have a TabControl with two items. <TabControl x:Name="tab" SelectionChanged="TabControl_SelectionChanged"> <TabItem Header="TabItem1"> <Grid /> </TabItem> <TabItem Header="TabItem2"> <Grid /> </TabItem> </TabControl> private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { Debug.WriteLine("Selected Index: " + tab.SelectedIndex); if (tab.SelectedIndex == 1) { tab.SelectedIndex = 0; } } when click 2nd item, 1st item have focus and print below. Selected Index: 1

Why is the tab page body not updating with a .NET tab control?

狂风中的少年 提交于 2021-01-27 09:39:01
问题 I am having a strange problem with the .NET TabControl in C# (Visual Studio 2010). Start a Windows Forms Application. Add a tab control and a button. Add two different labels to the two tab pages so you can differentiate them. The purpose of the button is just to act as a next button; subscribe to the its Click event with the code: tabControl1.SelectTab(1); Let's assume the user entered something wrong on the first tab, so when they try to go to the second tab we want to send them back, so