Results 1 to 4 of 4

Thread: Grouping Functions Within an OCX

  1. #1

    Thread Starter
    Lively Member Cenobitez's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, England
    Posts
    101

    Question Grouping Functions Within an OCX

    Hello Everyone, this is my first post, so i thought i'd say hi first )

    Down to my problem now, I am writting an OCX which in the region of 50 Functions and a few subs so far, the final aim to have 100+ least thats how many Idea's i have left approx.....

    The Functions will be in sets, the main sections at this point are like,
    Code:
    ControlName.FindWindowName
    ControlName.FindLocateBox
    ControlName.FindLocateName
    ControlName.FindLocateAddress
    and then there is the next step like
    Code:
    ControlName.GetWindowName
    ControlName.GetLocateBoxText
    ControlName.GetLocateName
    ControlName.GetLocateAddress
    I wanted to be able to group them at first i was thinking by Sections, like Locate, Profile then i determed, that i wanted to group them into like
    Code:
    ControlName.Get.FunctionName
    ControlName.Find.FunctionName
    ControlName.Set.FunctionName
    Much like u can with a text box and
    Code:
    text1.font.bold = true
    and
    Code:
    text1.FontBold
    Both the above work but u have the option of grouping them like
    Code:
    Text1.Font.Italic
    Text1.Font.Bold
    Text1.Font.Underline
    The order is like ControlName.Group.Function...

    I have thought about this, i thought maybe a custom data type, but then they dont really cover this area, Then i thought using an Enumerate, and then i was told collections are the way to do this...

    Can this be done in VB or is this a C thing or can it be done in VB ?

    Thanks For the help, Im finding out alot just by reading some of the other topics, stuff i hadn't even thought of but i think will be useful...

    ______
    Steve

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Hi Cenobitez,
    add a class module for each group.

    add the functions to the classes where they belong.

    in u'r usercontrol, add a public varialble for each group, with the name u want to show up when the user hit .

    this way u will have code like u wanted.

    If u need me to elaborate on this subject, let me know.
    -= a peet post =-

  3. #3

    Thread Starter
    Lively Member Cenobitez's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, England
    Posts
    101
    Thanks Peet, Let me have a play, if i have no luck then il ask for more, sometimes a shove in the right direction is better than being given it on a plate


    _____
    Steve

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    Ok
    -= a peet post =-

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