Results 1 to 8 of 8

Thread: Microsoft Form 2 Controls...

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Italy
    Posts
    90
    Hi!
    I have used in an application of mine the Microsoft Form 2 Contols; the problem is that when i click two times on a button very fast (in fact, dblclick) it remains pushed down executing only once the istruction click, while i want it to execute two times the istruction, as if there has been 2 single clicks.
    For example, if i press the button "9" two times, i want the program to write in the textfield "99" and return in the original-non-pressed state. Now it writes "9" and keeps pressed down!
    Thanks a lot

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    what's the butoon code
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Lively Member
    Join Date
    May 2000
    Location
    Norway
    Posts
    112
    Very easy answer.
    You have used the Toggle button control and NOT the Command button control.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Italy
    Posts
    90
    No, i used a command button... sob! Here's an example code:

    Private Sub CE_Click()
    Rem Clean the textfield
    Text1.Text = ""
    tmpTxt = ""
    End Sub

    I really can't understand why it happens!
    Thanks

  5. #5
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Very easy

    In the DoubleClick Event put this code:
    Code:
    Private Sub CommandButton1_DblClick(Cancel As MSForms.ReturnBoolean)
        Cancel = True
    End Sub

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    CLick event...
    Text1.Text = Text1.Text & 9

    [Edited by HeSaidJoe on 08-04-2000 at 03:02 PM]
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Sorry I didn't read your question carefully enough

    Try this
    Code:
    Option Explicit
    
    Private Sub CommandButton1_Click()
        Form1.Print "HI"
    End Sub
    
    Private Sub CommandButton1_DblClick(Cancel As MSForms.ReturnBoolean)
        Cancel = True
        CommandButton1_Click
    End Sub

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Italy
    Posts
    90
    GREAT! That worked very well! Thank a lot!

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