Results 1 to 13 of 13

Thread: Subclassing or Something?

  1. #1

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Subclassing or Something?

    I have a class which contains like three controls... Let's say it contains a FlexGrid, a TextBox and a ComboBox.

    I use this three controls to give the FlexGrid a feeling of being "Editable". So some of the Procedures of the controls have an equivalent inside of the class I created.

    For example, I could have the Text_KeyPress which would need to be called from the Form in the Text1_KeyPress.

    So this class saves me a lot of coding for each individual in the Form, but it still forces me to write in all the events I defined from the class and I was wondering if there could be a way to:

    1.- "Trap" or "Catch" these Procedures and make the class handle them automatically.
    2.- To raise the events after handling them (I know there is WithEvents and RaiseEvent, so I guess this can be done)

    3.- To have the controls inside the class so I wouldn't need to add them to the Form something like "Dim Text as New TextBox" (Which I know won't work)

    Well, that's it... Could you please guide me through this?

    Thanks in advance.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  2. #2

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Anyone? Martin, Manavo, Hack, Bruce, Rob...?

    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    What about making your own ocx?


    Has someone helped you? Then you can Rate their helpful post.

  4. #4

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    But that would imply I would need to register it manually when installing the program that has it.. Am I wrong?
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    How do you mean manually? The installer can register it just as it registers whatever else you ship along with your app (Common Dialog Control)...


    Has someone helped you? Then you can Rate their helpful post.

  6. #6

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    And if I am using the DTPicker I would need to add a reference to it to or what?
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  7. #7

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    I mean, lets think I have myControl.ocx and it has inside a DTPicker... Will it be registered too?
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    If you are using the DTPicker, you'll need to ship the OCX... But I'm thinking, you don't need to create the OCX seperatelly (different project). Look at the attachment and hopefully you'll see what I mean
    Attached Files Attached Files


    Has someone helped you? Then you can Rate their helpful post.

  9. #9
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by Tec-Nico
    I mean, lets think I have myControl.ocx and it has inside a DTPicker... Will it be registered too?
    The installer takes care of the registering. Which one are you using? P&D? Inno?


    Has someone helped you? Then you can Rate their helpful post.

  10. #10

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Thanks Manavo, I will check it.

    You always get me out of this kind of problems. If all goes fine I will publish my OCX in the CodeBank...

    Thanks again!
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  11. #11

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    I use P&D, Manavo.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  12. #12
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by Tec-Nico
    Thanks Manavo, I will check it.

    You always get me out of this kind of problems. If all goes fine I will publish my OCX in the CodeBank...

    Thanks again!
    It sounds good

    I would suggest that you use Inno though... I don't have much experience with either but almost everyone here praises Inno


    Has someone helped you? Then you can Rate their helpful post.

  13. #13

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Yeah, I have seen people here praising it too... But I haven't been able to test it because I have been very busy.

    I will test Inno as soon as I am not that occupied.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width