Results 1 to 2 of 2

Thread: Deselecting TextBoxs via by checking on the menu toolbar

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    Hey folks,

    I am new to the VB world; I have a form setup where it has 3 textboxs used to enter values to calculate financial things. I have the same selection of the textboxs on the menu bar. If I select it on the menu bar, it is supposed to prevent me from entering any relevent information in the textbox. I know I have to use If..Then statement in the code box and check feature. How do I go around in the design aspect? Thanxs in advance for the Help .

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Here is some code you can use. You can add the code for the 3rd TextBox and menu item. BTW, my menu items are sub-menus so that they can show check marks that indicate when the associated textbox is enabaled.
    Code:
    Private Sub mnuTB1_Click()
    
        ' Change the Enabled property each time the menu
        ' item is clicked
        Text1.Enabled = Not Text1.Enabled
        ' Set the Checked property of the menu item to
        ' Checked in Text1 is enabled, otherwise set it
        ' to not checked.
        mnuTB1.Checked = Text1.Enabled
        
    End Sub
    
    
    Private Sub mnuTB2_Click()
    
        Text2.Enabled = Not Text2.Enabled
        mnuTB2.Checked = Text2.Enabled
    
    End Sub

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

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