Results 1 to 4 of 4

Thread: [Resolved]Combobox/Style Issue

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Location
    Gorgeous Ontario
    Posts
    265

    Resolved [Resolved]Combobox/Style Issue

    Ok so I have an array of comboboxes set to DropDown List, so nobody can enter other data. Now I have cmd button to clear the form of all data. Since you can't write/clear the data in DropDown List style, I am switching the style of each to DropDown Combo first then clearing the data and returning the style back to DropDown List. Here's the code:

    VB Code:
    1. For i = 0 To 8
    2.                     Set cboFlash(i).Style = 0
    3.                 Next
    4.                
    5.                 For i = 0 To 8
    6.                     cboFlash(i).Text = ""
    7.                 Next
    8.  
    9.                 For i = 0 To 8
    10.                     Set cboFlash(i).Style = 2
    11.                 Next

    Now I have two errors:

    1. Compile Error: Invalid use of property - in regards to the .Style when I use the Set command.
    2. Compile Error: Can't assign to read-only property - when i remove Set command.

    Any suggestions?
    Last edited by Falconsbane; Jun 22nd, 2006 at 08:51 AM.

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Combobox/Style Issue

    what's wrong with just doing
    VB Code:
    1. cboFlash(i).Clear
    or do you mean you want to make the selection blank and not change the dropdown choices - if so, do:
    VB Code:
    1. cboFlash(i).ListIndex = -1

  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Combobox/Style Issue

    just use the listindex

    VB Code:
    1. cboFlash(i).ListIndex = -1


    EDIT: too slow
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Location
    Gorgeous Ontario
    Posts
    265

    Re: Combobox/Style Issue

    Thanks Guys, don't know what I was thinking, but that works wonderfully.

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