Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 :(

Software bugs are impossible to detect by anybody except the end user.
Posted

: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

Software bugs are impossible to detect by anybody except the end user.
Posted

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

Software bugs are impossible to detect by anybody except the end user.
Posted

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

Software bugs are impossible to detect by anybody except the end user.
  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

Software bugs are impossible to detect by anybody except the end user.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...