Computers & Internet Logo

Related Topics:

Posted on Jul 07, 2010

How to disable command button in visual basic

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

MVP:

An expert that got 5 achievements.

Governor:

An expert whose answer got voted for 20 times.

New Friend:

An expert that has 1 follower.

  • Contributor 30 Answers
  • Posted on Jul 23, 2010
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

MVP:

An expert that got 5 achievements.

Governor:

An expert whose answer got voted for 20 times.

New Friend:

An expert that has 1 follower.

Joined: Mar 30, 2010
Answers
30
Questions
0
Helped
7246
Points
49

  • tep 1 Open Visual Basic and select "Standard Exe" to create a new project.
  • Step 2 Add a button by clicking the square button tool on the right, and then clicking and dragging in the main window.
  • Step 3 Click the button once to open the "Properties" window on the right. Select the "(Name)" property, and type "myCmdButton" as the name.
  • Step 4 Double-click the button to open up the code-view window. Type the following in the white space under "Private Sub myCmdButton_Click()":
    myCmdButton.enabled = False;
  • Step 5 Click the blue "Run" button on the top toolbar of Visual Basic. Because you set enabled to "false" in the previous step, you will see your button grayed out, and nothing will happen when you click it.
  • 1 Related Answer

    Anonymous

    • 53 Answers
    • Posted on Oct 11, 2008

    SOURCE: in visual basic how will we change the backcolor of the form randomly when we click the command button?

    Paste this code on you button. This generates a random color.

    Red = Int(Rnd * 255)
    Green = Int(Rnd * 255)
    Blue = Int(Rnd * 255)


    Form1.BackColor = RGB(Red, Green, Blue)

    Ad

    Add Your Answer

    ×

    Uploading: 0%

    my-video-file.mp4

    Complete. Click "Add" to insert your video. Add

    ×

    Loading...
    Loading...

    124 views

    Ask a Question

    Usually answered in minutes!

    Top Microsoft Computers & Internet Experts

    Sudeep Chatterjee
    Sudeep Chatterjee

    Level 3 Expert

    3269 Answers

    Grand Canyon Tech
    Grand Canyon Tech

    Level 3 Expert

    3869 Answers

    Brad Brown

    Level 3 Expert

    19190 Answers

    Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

    Answer questions

    Manuals & User Guides

    Loading...