Posts Tagged ‘tabcontrol’
This question came in last Friday:
I’m trying to code a windows form in vb.net 2005. In my form I have 2 TabControls and a command button. The button is in the first TabControl, so what I want to do, is that when I click the button, in the first TabControl, the second TabControl gets opened.
I’m assuming here that what is really being asked is, “How do I change the active tab in a TabControl from some other event, like a button click in a tab?”
Republished by Blog Post Promoter
I just got off the phone with a client who is using the MS-AJAX TabControl in one of his applications and any time he causes a postback, the tab resets to the first tab.
If you’ve never seen the problem, you’re lucky. There are a couple of ways around the problem. The first and easiest if it works in your situation is to put the tab in an update panel so that you never actually do a full postback.
However, there are times when this won’t work. In this particular case it is because one of the tabs holds the file upload control, which can’t be used inside an update panel. (Another problem we had to find a way around last week.)
I just finished an interesting project that involved the AjaxToolKit’s Tab control. The first part of my assignment was to make the Tabs start about 160 pixels to the right of the left side of the container. Nothing a little CSS along with some nice interactive work with FireBug can’t take care of. And sure enough, I got that all running pretty quickly. The second part of the assignment was to make the far right tab visible, but disabled.
Now, you’d think a control that had a Enabled property and a Visible property would allow Enabled = false to display but be grayed out. But if you thought that about the Tab control, you’d be wrong. However, with an afternoon of snooping and a little help from jQuery, I was able to achieve the effect I was looking for.