CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    57

    How to set the style of the ComboBox control if it is dynamically added to the form

    I dynamically add a ComboBox control to the form:
    Set Combo1 = Controls.Add("VB.ComboBox", "Combo1")

    I want to set its style to "Dropdown list":
    Combo1.style = 2

    But there is a compile error: "Can't assign to read-only property".

    Then how to set the style of the ComboBox control if it is dynamically added to the form? Thanks a lot.

  2. #2
    Join Date
    Jun 2002
    Location
    West Virginia
    Posts
    131
    Check this site. Uses API.
    http://216.26.168.92/tips/tip122.html
    It uses check box and option box but maybe can use combo
    Last edited by WayneS; November 5th, 2002 at 05:00 PM.

+ Reply to Thread

Bookmarks

Posting Permissions

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



HTML5 Development Center

Click Here to Expand Forum to Full Width