Results 1 to 3 of 3

Thread: Desperately seeking help on activex

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    7

    Exclamation Desperately seeking help on activex

    Hi

    I have written a control that is basically a text box with a double click event. This event calls a form (which is inside the activex project) The form contains a numeric keypad, when the enter key is pressed I want the value stored in keypad1.output to be passed back for display in the text box. Can this be done? and if so I would be greatful of your help.

    Thanks

    BigAl
    hmmmmm Dohh-nutssssss

  2. #2
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    Orlando
    Posts
    392

    Don't panic!

    No one stops you from doing this.

    You can do it using the following code in the Text Boxes double click event.

    VB Code:
    1. txtBox.Text = frmKeyPad.GetOutPut


    What? That form doesn't have a GetOutPut Function? Well, you have to add that then. Here is the function:

    VB Code:
    1. 'Add a Form Level boolean variable called Cancelled
    2. Public Function GetOutPut() as Integer 'Or whatever data type you need
    3.     Cancelled = False
    4.     Me.Show vbModal
    5.     If Not Cancelled Then
    6.         GetOutPut =  Me.OutPut     'I am assuming you have the OutPut property populated properly
    7.     End If
    8. End Function
    9.  
    10. 'The code for the Ok button's click Event
    11. Private Sub cmdOk_Click()
    12.     Unload Me
    13. End Sub
    14.  
    15. 'Code for the Cancel button's click Event
    16. Private Sub cmdCancel_Click()
    17.     Cancelled = True
    18.     Unload Me
    19. End Sub

    Does it look it won't work this way? Why not give it a try? Don't forget to adapt the code.

    Cheers.
    Abu Haider
    ____________________________
    100% Data Validation for the MS DataGrid Control. Plus Support for Custom and Foreign Lists, DatePicker and much more...
    The DataGridEnhancer


    I often point to a place where the problem has been discussed, instead of giving you the code that solves it. This is for good, may be you will understand some day...

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Posts
    7

    Smile ThankYo

    Hi

    Thanks Abu, with a little adaptation it now works.

    Many Thanks, Once again

    BigAl
    hmmmmm Dohh-nutssssss

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