473,947 Members | 3,612 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable tab pages

Hi

I have a program with a tabControl which contains 6 tabs. During the
execution of the program I want to Enable/Disable some of the tabs but
I did not find any way to do that. I've tried to use the Hide/Show
methods but without success.

Does anyone have any suggestion on this?

Thanks!

Eduardo

Jun 20 '06 #1
4 9328
Eduardo,

Did you check the Enabled property on the TabPage class?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<em*******@gmai l.com> wrote in message
news:11******** **************@ g10g2000cwb.goo glegroups.com.. .
Hi

I have a program with a tabControl which contains 6 tabs. During the
execution of the program I want to Enable/Disable some of the tabs but
I did not find any way to do that. I've tried to use the Hide/Show
methods but without success.

Does anyone have any suggestion on this?

Thanks!

Eduardo

Jun 20 '06 #2
From
<http://msdn2.microsoft .com/en-us/library/system.windows. forms.tabpage.e nabled.aspx>:

".NET Framework Class Library
TabPage.Enabled Property
This property supports the .NET Framework infrastructure and is not
intended to be used directly from your code.
This member is not meaningful for this control."

So, the tabcontrol doesn't really support this. There's lots of code on
the web to show you how to override the drawing of your tabcontrol and
disable tabs. In a pinch, it may be enough to handle the "Selecting"
event of the tabcontrol like this:

private void tabControl1_Sel ecting(object sender,
TabControlCance lEventArgs e) {
try {
if ( ! tabShouldBeEnab led(e.TabPageIn dex) )
e.Cancel = true;
} catch (Exception ex) {
_bugSentry.Repo rt(ex);
}
}
Did you check the Enabled property on the TabPage class?


Jun 21 '06 #3
I had to do this and myapproach was to handle
TabControl.Sele ctedIndexChange d event
in this event I check if user can go on new index tab and if not I
switch them back to last tab and show appropriate message
I hope this helps
Galin Iliev[MCSD.NET]
www.galcho.com

em*******@gmail .com wrote:
Hi

I have a program with a tabControl which contains 6 tabs. During the
execution of the program I want to Enable/Disable some of the tabs but
I did not find any way to do that. I've tried to use the Hide/Show
methods but without success.

Does anyone have any suggestion on this?

Thanks!

Eduardo


Jun 21 '06 #4
I simply remove the relevant tab pages from the tab control when
they're disabled, and add them back when they're enabled.

The only hassle is that you can only add to the end, so it has to be
the last tab page(s) that is/are done like this.

em*******@gmail .com wrote:
Hi

I have a program with a tabControl which contains 6 tabs. During the
execution of the program I want to Enable/Disable some of the tabs but
I did not find any way to do that. I've tried to use the Hide/Show
methods but without success.

Does anyone have any suggestion on this?

Thanks!

Eduardo


Jun 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7952
by: AmigaLemming | last post by:
As I understand my admins installed a PHP server and now my plain HTML pages also want to set a PHPSESSID cookie when loaded into a browser. Can I suppress this, e.g. by creating a configuration file like ..htaccess somewhere in my public_html directory? Is it possible to disable the setting of PHPSESSID cookies for plain HTML pages in general and maybe for PHP pages that don't need to track any session information?
21
3288
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" http://www.tonymarston.co.uk/php-mysql/backbuttonblues.html -- Tony Marston http://www.tonymarston.net
4
11699
by: Phil | last post by:
Hello all, Can anybody give me any ideas on how to disable a tab page within a tab control. I have a tab control tabClients with 3 pages. I would like to disable pages 2 & 3 when a certain condition is met. Thanks in Advance. Phil.
6
2818
by: Raghu Raman | last post by:
Hi, we are doing an in house project in c#.net(asp.net).We wanted to close our application when ever the user presses the SIGNOUT button. Even though we programtically disconnects them from the database,when we press the Internet explorers Back button ,all the browsed pages are displayed with the data**. 1.could you pls tell me how to disable the back-button of IE
1
1804
by: Bob | last post by:
Does anyone know how to disable javascript in the new Netscape 8 -- for off line testing (like can be done readily with the current MSIE, Firefox or Opera browsers) ? When I try tools -> options -> site controls -> web features and check or uncheck the 'enable javascript' box, nothing changes -- it stays enabled. I've searched FAQs, archives and google about the issue, with no luck.
7
4649
by: Chris Hayes | last post by:
Hello All, I have grown very annoyed with the ASP.NET Development Server since I still develop with a full instance of IIS and would like to know is there a nice clean way to disable the ASP.NET DEvelopment Server - I simply do not want to use it, nor do I want it fire up when I'm trying to debug! Thanks, Chris
2
3592
by: ad | last post by:
I use authorization to Form in the root Web.config But now I want to disable the Form authentication when request some web pages How can I do?
56
3927
by: Deepan HTML | last post by:
Hi All, Currently i am working in a framed environment where i have divided the window as 20% and 80% and the 20% is used for navigation purpose and right frame for displaying the orignal content. Now i want to Disable ad Enable the menu items which are placed in the left frame for navigation purpose. Can any of you input me with any idea as how to proceed? If you need any other information then please let me know.
4
2299
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
8
5439
by: alamodgal | last post by:
hiiiiiiiiiii everybody, pls solve my problem if u can? Actualy what happens in my site when i press enter key it will show some secured information related to my site.So for that i have use this code to disable enter key: <script type="text/javascript" language="javascript"> /*-----script to disable F5 key begin-----*/ var version = navigator.appVersion; function...
0
10162
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9982
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11153
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10689
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8253
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7427
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6331
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3541
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.