I'm making a winform in C# using Visual Studio 2008.
Currently, I have a tabcontrol, containing 2 tabs.
In the first the, there is a button. When I click it, I must be taken to the second tab.
Problem is, I don't know how. I've tried debugging, looking into al kinds of Properties and messing around with them, but I found nothing that helps.
Does anybody here know how to pull this off?
Extra info: my variables are named tabControl1, textTab and logTab.
I'm in textTab, click on a button there and I want to be taken to logTab. That's it basically.
Did you try this?
tabControl1.SelectedTab = logTab;
You can set either the SelectedIndex property or the SelectedTab property of the tab control to switch tabs.
Related
As the title suggests, I am having some issues when trying to programmatically check a radio button in a Windows 8 Store App. So I realize on a WinForms .NET application I would do something like:
rad.Checked = true;
In WinRT, I am trying this:
control.RadYes.IsChecked = true;
This is what I would assume would cause the Radio Button to be pressed; however, in the UI, it still shows nothing is checked. If I place a breakpoint, I can hover over RadYes, and it shows the property = true. Is this not the correct way to do this?
The idea, is I am allowing a user to pick back up where they left on when filling out a form. So it retrieves the values from the database and correctly getting into my switch/case to set the value--but the UI doesn't change.
Another thing I noticed that I am also about to try--is that I didn't assign a Group to my 3 Radio Buttons. Can someone clue me in as to what I might be doing wrong? Thanks!
OK, so my solution was to add GroupName="YesNoNA" in the XAML controls. I didn't change anything else, and now it works. I searched for an hour trying to find information about this, so hopefully this will help someone else out.
puu.sh/kiQ0k/aa28192731.png
Does anyone know how I can manipulate the objects in this form? I would really like to be able to edit some of the tabs. It's using DevExpress v14.1
To edit the tabs, just click the tab control and use the design time helper icon on the tab controls upper right corner. There, you can find a link called "Tab pages".
Alternatively you can just select the tab control by clicking and head over to the properties window (press F4) as you can do with every control. There, you find a property called TabPages.
If you want to edit the controls on the tabs, just do so by selecting them per mouse click and change the controls' properties on the properties window (press F4).
The issue was that DevExpress wasn't installed on my system and thus wouldn't let me modify the elements. Simply installing the right version fixed the issue.
I apologize if this is a simple question. I'm very new to XAML, and I'm trying to understand app development more.
Basically, I have a section on the bottom of the display reserved for a pop-up AppBar. From what I understand, this pops up on an edge swipe, but I'd like to use some sort of a call to bring it up. This way I can have various varieties of the AppBar pop-up when the situation calls for it.
How would I go about accomplishing this?
OR, is there another approach that might work better?
Thanks for your time!
The page has a BottomAppBar property (<Page.BottomAppBar>). Here you can enter a AppBar control and inside of it any XAML you want. Then you can show and hide anything through the Visiblity property from code. So - you can for example add two Gridcontrols in the AppBar and always display one of them.
If you're looking to create multiple AppBars for use on the same page, you'll have to do so in the code behind. See this link:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff431786(v=vs.105).aspx
Once you've created them, set the IsVisible property to true/false to show/hide them.
I have a form with a bunch of panels, and some panels inside groupboxes. When using the TabOrder tool in Vs2005, the controls outside of containers are given integers (0), the controls inside panels are given decimals (72.0), and the controls within panels within groupboxes are given three-part values (73.73.0). Unfortunately the resulting tab order has nothing to do with the order I clicked my controls.
Does this tool simply not support nested containers? Am I doing something wrong? Perhaps holding Shift- or Ctrl- when I click (I've tried these with no success)?
Am I going to be forced to manually type in three-part tab orders for all my controls? That would be a bummer.
The tab order tool is not designed for you to enter values manually; it is designed for you to click on controls in the order that you'd like them to progress as the user tabs.
The numbers are not decimals; they represent the tab order of the control within its parent container. For example, if you have a Form with a Panel named panel1 and a Button inside of it named button1, then button1 would display a number like:
X.Y
X is the tab order of panel1
Y is the tab order of button1 within panel1.
I will acknowledge that the designer isn't as intuitive (or transparent) as it probably should be, but it does work.
I had the same problem with textboxes and buttons within group box in VS2010. TabOrder tool was just useless: Tab orders were broken no matter how I re-ordered the tab stops. In order to make the correct tab order I had to re-order of how controls are added to the group box in form designer initialization code:
this.groupBox2.Controls.Add(this.startTimeTextBox);
this.groupBox2.Controls.Add(this.endTimeTextBox);
this.groupBox2.Controls.Add(this.exitButton);
This way tab order would be startTimeTextBox -> endTimeTextBox -> exitButton and so on.
I think I figured out the way to do it in the designer: the trick is apparently that you have to click the panels/groupboxes as well in order to assign the different parts of the full ordering; in this way, it seems that a bredth-first clicking method needs to be used as opposed to clicking the child controls themselves.
Kinda sad, since it forces you to know the full structure of the whole form instead of just what the user sees.
I had this same problem and discovered this tool: http://archive.msdn.microsoft.com/cdstabindex
I had to change the manifest to make it work with VS2010 though. Also, I've modified the source code for myself to make the UI a little better, but even as it is, I would recommend having a look at this tool.
Remove Group-boxes from Controls and try again this works for me :)
Is there a way to set the visibility of a single tab in a tabcontrol? I thought something simple like this should work, but does not seem to to anything.
tabControl1.TabPages[1].Visible = false;
tabControl1.Refresh();
There will be a main tab that always shows but I want to have other tabs that I can "turn on\off". I don't want to remove the tabs since I may need to show then again.
fk
Times haven't changed since 2.0:
StackOverflow - How to hide TabPage from TabControl
You can remove the tabControl page
this.tControl1.TabPages.Remove(this.tControl1.TabPages["tabPageName"]);
It's obviously not part of the standard Windows Forms library, but the Infragistics UltraTabControl has (among other features) a Visible property for each tab page.