tabpage

Hiding/blocking tabs using windows forms in c#

此生再无相见时 提交于 2019-12-10 15:24:08
问题 The thing is that i have a 'log in window' and a 'mainwindow' that is called after pressing the log in button or the "VISITANT" button If pressing the log in button, the whole system will come out, and if i press the VISITANT button, one tab should disappear or be blocked or something. private void visitant(object sender, EventArgs e) { mainwindow menu = new mainwindow(); menu.Show(); //mainwindow.tabPage1.Enabled = false; //attempt1 //mainwindow.tabPage1.Visible = false; //attempt1 //System

Make tabpage not process mousewheel events (C#)

拜拜、爱过 提交于 2019-12-10 11:47:31
问题 I have made a MDI (tabbed) application that uses PictureBoxes inside TabPages. The picturebox is sometimes larger then the tabpage, so scrollbars appear. It is written in C# using Windows Forms. Inside my tabpage, I capture and process mouse wheel events in the MouseWheel event (i use it to rotate some objects I draw in the picturebox). But when I have the scrollbars, when I rotate the mouse wheel, my objects rotate, but the tabpage also scrolls down. How can I make the tabpage not process

Unable to crawl some href in a webpage using python and beautifulsoup

陌路散爱 提交于 2019-12-07 13:53:12
问题 I am currently crawling a web page using Python 3.4 and bs4 in order to collect the match results played by Serbia in Rio2016. So the url here contains links to all the match results she played, for example this. Then I found that the link is located in the html source like this: <a href="/en/volleyball/women/7168-serbia-italy/post" ng-href="/en/volleyball/women/7168-serbia-italy/post"> <span class="score ng-binding">3 - 0</span> </a> But after several trials, this href="/en/volleyball/women

How to prevent delay loading of a UserControl in a TabControl?

Deadly 提交于 2019-12-07 13:51:18
问题 I have just discovered that UserControls in a TabControl will not load until the parent TabPage is selected. Is there a way to prevent this delay loading? I need to initialize the UserControls when the main form loads. 回答1: The TabControl does not treat its controls specially, in fact it is normal under all circumstances for the Load event on a UserControl to occur immediately before the control is displayed for the first time. The TabPage is responsible for showing the control, therefore it

How to make TabPages draggable?

南楼画角 提交于 2019-12-07 07:10:27
问题 I'd like to enable user to rearrange TabPages order by dragging and dropping. Moreover it'd be cool to enable user to drag TabPages from one TabControl to another. Both the way like in Firefox and Total Commander. How to achieve this? 回答1: reordering TabPages with drag and drop - by Ludwig B. inspired by http://dotnetrix.co.uk/tabcontrol.htm#tip7 private void tc_MouseDown(object sender, MouseEventArgs e) { // store clicked tab TabControl tc = (TabControl)sender; int hover_index = this

C# Winforms TabControl elements reading as empty until TabPage selected

Deadly 提交于 2019-12-06 11:12:30
I have Winform app I am writing in C#. On my form, I have a TabControl with seven pages, each full of elements (TextBoxes and DropDownLists, primarily). I pull some information in with a DataReader, populate a DataTable, and use the elements' DataBindings.Add method to fill those elements with the current values. The user is able to enter data into these elements, press "Save", and I then set the parameters of an UPDATE query using the elements' Text fields. For instance: updateCommand.Parameters.Add("@CustomerName", SqlDbType.VarChar, 100).Value = CustomerName.Text; The problem I have is that

How to make Tab pages' widths fit into the TabControl's width

时间秒杀一切 提交于 2019-12-06 01:43:21
问题 I have a TabControl with two tab pages. How can I make the tab pages fit into the width of the TabControl like shown in the below screenshot. I tried with the following line of code but it does not work either. tabControl1.SizeMode = TabSizeMode.FillToRight; 回答1: First, set your tabControl1 size mode: tabControl1.SizeMode = TabSizeMode.Fixed; Then you have to recalculate width of the tab page header: tabControl1.ItemSize = new Size(tabControl1.Width / tabControl1.TabCount, 0); Pay attention:

How to prevent delay loading of a UserControl in a TabControl?

谁说我不能喝 提交于 2019-12-05 21:28:39
I have just discovered that UserControls in a TabControl will not load until the parent TabPage is selected. Is there a way to prevent this delay loading? I need to initialize the UserControls when the main form loads. The TabControl does not treat its controls specially, in fact it is normal under all circumstances for the Load event on a UserControl to occur immediately before the control is displayed for the first time. The TabPage is responsible for showing the control, therefore it will only be 'loaded' when first selected. To overcome this (perfectly normal) Windows Forms behaviour, you

How to make TabPages draggable?

两盒软妹~` 提交于 2019-12-05 12:29:04
I'd like to enable user to rearrange TabPages order by dragging and dropping. Moreover it'd be cool to enable user to drag TabPages from one TabControl to another. Both the way like in Firefox and Total Commander. How to achieve this? reordering TabPages with drag and drop - by Ludwig B. inspired by http://dotnetrix.co.uk/tabcontrol.htm#tip7 private void tc_MouseDown(object sender, MouseEventArgs e) { // store clicked tab TabControl tc = (TabControl)sender; int hover_index = this.getHoverTabIndex(tc); if (hover_index >= 0) { tc.Tag = tc.TabPages[hover_index]; } } private void tc_MouseUp(object

Winforms TabControl alignment problems

南楼画角 提交于 2019-12-05 00:42:14
问题 When I set TabControl alignment to Left or Right it leaves this huge space between tab buttons and tab page area. How to get rid of this useless space? TabControl.Appearance is set to Buttons because if it is set to Normal the text on buttons disappear. UPDATE: When i set TabControl.Alignment to Bottom and TabControl.Appearance to Normal buttons look inverted (orange line should be below) When i set TabControl.Alignment to Bottom and TabControl.Appearance to Buttons , There is no area on