+ Reply to Thread
Results 1 to 5 of 5

Thread: Disable typing in combobox

  1. #1
    Programming Expert Crane is on a distinguished road Crane's Avatar
    Join Date
    Nov 2005
    Posts
    399

    Disable typing in combobox

    I would like to disable typing in a combobox without disabling the control. The user would still be able to use the drop-down list but would not be able to type.

    How?

  2. #2
    Lop
    Lop is offline
    Speaks fluent binary Lop has a spectacular aura about Lop has a spectacular aura about Lop's Avatar
    Join Date
    May 2006
    Posts
    1,179
    This isn't so hard. You have to capture the keypress event for that control.

    Code:
    private: System::Void comboBox1_KeyPress(System::Object^  sender, System::Windows::Forms::KeyPressEventArgs^  e) {
    			 e->Handled = true;
    		 }
    Lop

  3. #3
    Programming Expert Crane is on a distinguished road Crane's Avatar
    Join Date
    Nov 2005
    Posts
    399
    Thanks lop, works perfect

  4. #4
    Lop
    Lop is offline
    Speaks fluent binary Lop has a spectacular aura about Lop has a spectacular aura about Lop's Avatar
    Join Date
    May 2006
    Posts
    1,179
    No problem!
    Lop

  5. #5
    Newbie SpaceGhost is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    1

    Re: Disable typing in combobox

    You have to do this:

    myComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Disable typing in a combo box
    By Chan in forum C# Programming
    Replies: 8
    Last Post: 06-14-2009, 10:36 PM
  2. Disable a button
    By reachpradeep in forum ASP, ASP.NET and Coldfusion
    Replies: 1
    Last Post: 03-03-2007, 02:35 PM
  3. Disable cap Lock at login screen?
    By Lop in forum C# Programming
    Replies: 0
    Last Post: 01-25-2007, 08:18 AM
  4. C# to disable a device
    By NeedHelp in forum C# Programming
    Replies: 4
    Last Post: 07-24-2006, 02:34 PM
  5. Howto: Populate info into combobox
    By dirkfirst in forum C# Programming
    Replies: 3
    Last Post: 07-05-2006, 07:40 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts