Results 1 to 3 of 3

Thread: Active X accessing Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    2

    Cool

    Good evening/morning

    I have a question about making an activeX control work with a form. I am quite new and am getting a little frustrated with this.

    My dilema is that I am making an activeX control that has a Command button on it, along with a Microsoft Common Dialog Control (also ActiveX)

    The end product that I wish to achieve is, when the command button is pressed that the color dialog comes up. You pick the color, click OK, and the form changes to that color.

    However, all the code is contained in the ActiveX control and none in the Form.

    This is working up to this point. However I don't want to bore you with my several attempts at failing

    Active X Control

    Private Sub cmdColor_Click()
    RaiseEvent myCol
    dlgPicCol.ShowColor
    End Sub

    Thank you for all replies,
    I really appreciate this,
    burnvega

  2. #2
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    My gess would be to show and get the color information before raising the event. I'd also set up the Event to have parameters so that You would be able to pass them to your main form.

    Code:
    Public Event MyCol(Color As Variant)
    
    Private Sub cmdColor_Click()
        dlgPicCol.ShowColor
        RaiseEvent MyCol(dlgPicCol.Color)
    End Sub
    I haven't actually worked with the Color Picker of the common dialog control, but I hope that this helps you out.
    -Excalibur

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    2
    I think that is my problem,, not being able set up the perameters to acces the main Form

    Thank you for your reply Excalibur


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