AlexCode Posted January 13, 2004 Posted January 13, 2004 As the Framework controls shows us every single day... they suck! And the TabControl its another good example of that! Is it asking too much to want to desable a TabPage? Is there a way I can achieve this goal? Thanks! Alex :( Quote Software bugs are impossible to detect by anybody except the end user.
feurich Posted January 14, 2004 Posted January 14, 2004 Maybe this ?? TabPage1.enabled = False Quote Trust the Universe
AlexCode Posted January 14, 2004 Author Posted January 14, 2004 :P Certainlly isn't that! Too Easy! :D I want to desable the Tab itself, and desableling lake you told, it only desables the objects on the tab but still allows the user to select that tab... Got it? Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
feurich Posted January 14, 2004 Posted January 14, 2004 Sorry For that :-) I knew it was to easy, with a track record of 434 I should have known. But maybe you can look at the following website: http://support.cavo.com/(biye55yaf1ybsgzwmibpl355)/main.aspx And search for tabpages It isn't exact what you need but maybe you can derive some answers from it. Quote Trust the Universe
AlexCode Posted January 14, 2004 Author Posted January 14, 2004 Ok, I've seen it but I quite don't understand what it is... in fact I don't even know what program opens an *.AEF file... Opening it with NotePad I saw that it's C++ code, but also it's a 1999/2000 code... not that stuff we can apply on a .net TabControl, or at least I can't... my C++ skills are worse than u can imagine! :D Thaks anyway... I'll keep looking for somethig as I think this is an important issue to overcome... Thanks Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
Administrators PlausiblyDamp Posted January 14, 2004 Administrators Posted January 14, 2004 Could you not remove the tabpage in question instead of disabling it? I've had to do it that way myself before now, annoying that even visible = false doesn't work on a tabpage either. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
AlexCode Posted January 14, 2004 Author Posted January 14, 2004 Yeah... that visible issue sucks just like the complete TabControl do... Latelly I've used the Magic TabControl... it seemed to work fine and had all theese issues working like a charm and plus, on thet time, it was free! But time and experience told me that it has other bug... if sometimes break the databindings of the contained objects. Now this problem: Right now, I've the tabs removed like you said but I think its more clear to the user, in this case, he can see what he have and what he don't have if the tabs were there but desabled... The most strange thing is that I can't find so many people asking for this as I expected when I started searching on Google... I'll keep trying... Thanks. Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
Administrators PlausiblyDamp Posted January 14, 2004 Administrators Posted January 14, 2004 Could you not use a wizard style, with a previous and next button and a point by point guide to let the user now how far they have progressed? Divil has quite a nice wizard component on his web site http://www.divil.co.uk/net/controls/wizardcontrol/ that is pretty easy to use. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Grimfort Posted January 14, 2004 Posted January 14, 2004 Why dont you just check if the user is tying to change to that tab, and just move them back to the old one ? Quote
AlexCode Posted January 15, 2004 Author Posted January 15, 2004 That could be an option but the Tab itself wouldn't be shaded... I'v found a way to work this out. Possibli I'll make an IExpandableProperty to add this functionallity to the tab controls... It still needs some work but it's a start... Dim CurrentIndex As Integer = -1 Dim TPs As New ArrayList Structure stTPs Dim TP As TabPage Dim Enabled As Boolean End Structure Private Sub TabControl1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabControl1.MouseMove Me.TextBox1.Text = e.X & ";" & e.Y End Sub Private Sub TabControl1_ControlAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles TabControl1.ControlAdded Dim TP As New stTPs TP.TP = e.Control If Me.TabControl1.TabPages.Count > 2 Then TP.Enabled = False Else TP.Enabled = True End If TPs.Add(TP) End Sub Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged For Each TPage As stTPs In TPs If TPage.TP Is Me.TabControl1.SelectedTab Then If TPage.Enabled Then CurrentIndex = Me.TabControl1.SelectedIndex Else Me.TabControl1.SelectedIndex = CurrentIndex End If Exit Sub End If Next End Sub Private Sub TabControl1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles TabControl1.DrawItem For Each TP As stTPs In TPs If TP.TP Is Me.TabControl1.TabPages(e.Index) Then If TP.Enabled Then e.Graphics.DrawString(Me.TabControl1.TabPages(e.Index).Text, Me.Font, System.Drawing.Brushes.Black, 4 + (62 * e.Index), 4) Else e.Graphics.DrawString(Me.TabControl1.TabPages(e.Index).Text, Me.Font, System.Drawing.Brushes.Gray, 4 + (62 * e.Index), 4) End If End If Next End Sub Private Sub TabControl1_ControlRemoved(ByVal sender As Object, ByVal e As System.Windows.Forms.ControlEventArgs) Handles TabControl1.ControlRemoved End Sub Private Sub TabControl1_TabIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabControl1.TabIndexChanged CurrentIndex = Me.TabControl1.SelectedIndex End Sub Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.