Search results for query: *

  1. D

    TabControl & custom classes

    We think identically! I was thinking of exactly the same thing for the multiline - I didn't bother implementing it because I thought it was very dodgy. Are there any events that would get triggered before the line-move thing? I also noticed the single line visibility check bug. I was just about...
  2. D

    TabControl & custom classes

    Since Selecting is the first in order, I've changed the MouseDown to MouseClicked. There's still a bit of weird behaviour when dealing with multiline tabcontrols, but I'm at the stage where I don't care anymore ;) Thanks heaps for all your help! You're a legend!
  3. D

    TabControl & custom classes

    Just a quick question: Does the Selecting event get triggered before MouseUp?
  4. D

    Vb.Net Tab Control

    To remove a page you can use TabControlName.TabPages.Remove(...) (or .RemoveAt(...), .RemoveByKey(...)) You might also want to have a look at http://homepage.ntlworld.com/mdaudi100/alternate/tabcontrols.html The last code snippet is an implementation of a HideTab property.
  5. D

    TabControl & custom classes

    CheckSize is set in OnDrawItem. Presumably this would be executed before any MouseDown events, etc? Thanks for the handler tip. I couldn't see it before, so I assumed i had to override. The reason the Selecting thing wasn't working was because of the loop in the OnMouseDown. The boolean was...
  6. D

    TabControl & custom classes

    Yeah thats what I was thinking with the Invalidate. I can't tell the difference though. Maybe once I start adding more tabs. Anyway, its still the way to go. I've changed the CustomTabControl's SizeMode to Fixed, and for some reason that seems to make it all better (although the tabs are...
  7. D

    TabControl & custom classes

    Good spot on the "If Not..." bit! I only realized that last night too... Also, thanks for the Me.Invalidate(checkRect) - not sure if its making any difference in terms of performance, but it has to be better than the Me.Refresh() that I was doing! With the Selecting event, I know that e.Cancel...
  8. D

    TabControl & custom classes

    Just in case anybody else was having similar problems,I've finally got the event thing to work. Here is my code in the CheckedTabControl Class: Protected Overrides Sub OnMouseClick(ByVal e As System.Windows.Forms.MouseEventArgs) For i As Integer = 0 To Me.TabCount - 1 Dim...
  9. D

    TabControl & custom classes

    I omitted the line Me.Controls.Add(cb) because that adds the checkbox to the tabpage, not the actual top tab bit. I'm still using the CheckBoxRenderer in the CheckedTabControl's OnDrawItem sub. Because this is just rendering the checkbox & not actually putting one there, I have to create a...
  10. D

    TabControl & custom classes

    Here's the code I have in the CheckedTabControl class. For some reason it doesn't seem to respond (I'm trying to get it to respond to double-clicks in the checkbox area, which is 13 x 13 pixels). I know the event is triggered because a simple trace message amongst the code gets triggered. I...
  11. D

    TabControl & custom classes

    Thats great to know! In fact, that sort-of fixes most of my problems! Using a checkbox instead of a boolean does simplify things a little bit (I am mimicking a checkbox anyway!), and the "IsChecked() is not a member..." problem is fixed when I DirectCast it and use IsChecked on that... Its an...
  12. D

    TabControl & custom classes

    Grrrr! I'm an absolute idiot! I was creating a TabPage instead of a CustomTabPage in Form1_Load ever since I rename the (custom) TabPage class! Thanks JohnH! Here's the code I have at the moment: Imports System Imports System.Drawing Imports System.Windows.Forms Imports...
  13. D

    TabControl & custom classes

    At Dim _TabPage As CheckedTabPage = DirectCast(Me.SelectedTab, CheckedTabPage) I get: This is the same error I got when trying to CType the standard tab to my custom one. I don't really understand why though - the only real difference between the two is the boolean value, and that is given a...
  14. D

    TabControl & custom classes

    Hi guys, I'm trying to implement a TabPage that also has a checkbox displayed with the text (and hence, a boolean state). I've set the TabControl to OwnerDrawFixed, and managed to display the checkbox using CheckboxRenderer. I've also made a custom TabPage class that has an IsChecked property...
Back
Top