Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 9 of 9

Thread: ActiveX Combo box tutorials

  1. #1
    Join Date
    6th April 2011
    Posts
    74

    ActiveX Combo box tutorials

    I'm wondering if there are any ActiveX combo box tutorials with a list of what the commands mean. I've googled things and seen the microsoft explination, but i was looking for more information than that.

    I've tried messing with these for a few days to get it to do what I want. I've posted to multiple boards with no response.

    for example, I went my backstyle to be transparent and I want it to remain transparent after I make a selection and move off of the combobox.

    I thought maybe the VBA lostfocus option would do that if i set the backstyle to transparent through that, but it hasn't worked.

    so, I've decide that maybe I don't really know what excel means when it says 'focus'.

    That amoung other questions.

    Any suggestions on where i can go? Thank you.

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    2nd May 2008
    Location
    Ubique
    Posts
    1,893

    Re: ActiveX Combo box tutorials

    If the control is on a worksheet, then the transparency should only apply when the control does not have the focus and there is no way round that that I know of. (You can also just set it at design time).
    Rory
    Theory is when you know something, but it doesnít work. Practice is when something works, but you donít know why. Programmers combine theory and practice: nothing works and they donít know why

  3. #3
    Join Date
    6th April 2011
    Posts
    74

    Re: ActiveX Combo box tutorials

    Thanks for your response, Rory.

    However, I guess that's where I'm getting confused. What does it mean for the combobox to have 'focus'. I felt like it meant whenever the combo box was selected. So, I would go to the combobox, pick my selection and then move on. At that point, the combobox would turn transparent, leaving the selection, and it's all good in the hood.

    I feel like there should be a way to do it because if, for example, (1) I make a selection in the combo box, then I change the properties of the combobox to transparent, it goes to transparent with the selection. OR, (2) if I save the workbook, close and reopen, the combobox is transparent with the selection I saved it with.

    That being said, I was hoping there was a way, through VBA, to either change the backstyle to transparent, thereby reseting that property of the combobox, (1) above. OR, or refreshing the workbook as if it was saved, closed and reopened, (2) aboved.

    Any thoughts?

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    2nd May 2008
    Location
    Ubique
    Posts
    1,893

    Re: ActiveX Combo box tutorials

    Quote Originally Posted by freekrob View Post
    I felt like it meant whenever the combo box was selected. So, I would go to the combobox, pick my selection and then move on. At that point, the combobox would turn transparent, leaving the selection, and it's all good in the hood.
    That's how it should work and does for me. However ActiveX controls on worksheets are notoriously prone to odd behaviour.
    Which version of Excel are you using?
    Rory
    Theory is when you know something, but it doesnít work. Practice is when something works, but you donít know why. Programmers combine theory and practice: nothing works and they donít know why

  5. #5
    Join Date
    6th April 2011
    Posts
    74

    Re: ActiveX Combo box tutorials

    I'm currently using 2003. Let me explain my statement, slightly, as I was confused when I read my own quote and want to make sure I'm explaining clearly.

    ...I would go to the combobox, pick my selection and then move on (to another cell, or another combobox).

    At that point, the combobox would turn transparent, leaving the selection (it would maintain it's transparency after I moved on but leave the selection).

    ...

    Part of the reason the whole transparency thing matters is (1) for the look. The Combobox sits over a cell that has a bottom border, acting as a line to type on. Without the transparent nature, you can't see that line, or the type from the combo box looks ackward hanging over it. (2), I have some formulas in the cells under the combo boxes which use the vlookup function to auto fill if applicable.

    That's probably more info than you needed or wanted, but what you gonna do?

    Thanks for your help thus far!

    Excel Video Tutorials / Excel Dashboards Reports


  6. #6
    Join Date
    2nd May 2008
    Location
    Ubique
    Posts
    1,893

    Re: ActiveX Combo box tutorials

    Just tested in 2003 and that is how it works there too. The combo is transparent while not selected.
    Rory
    Theory is when you know something, but it doesnít work. Practice is when something works, but you donít know why. Programmers combine theory and practice: nothing works and they donít know why

  7. #7
    Join Date
    6th April 2011
    Posts
    74

    Re: ActiveX Combo box tutorials

    Maybe I'm missing something then. Like I said, the combo box is transparent, with or without a selection from its list, when I open the file initially, or if I change something in the properties and the backstyle was set to transparent. Would you mind taking a look at my properties in the form of the attached image?
    Maybe something is wrong. The only items I change, other than size, are the ones marked with red dots.
    frkrb combobox.jpg

    Additionally, the only code I currently have set for this combo box is:

    VB:
    Private Sub ModelNo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) 
         
        If KeyCode = 9 Then 
            Range("Q9").Select 
        End If 
         
    End Sub 
    
    
    Thanks!

    Excel Video Tutorials / Excel Dashboards Reports


  8. #8
    Join Date
    2nd May 2008
    Location
    Ubique
    Posts
    1,893

    Re: ActiveX Combo box tutorials

    Did I mention they were flaky? In my sample, my combo has started behaving the same as your even though I hadn't changed anything. Adding this seems to fix the transparency:
    VB:
     
    Private Sub ModelNo_LostFocus() 
        With ModelNo 
            .Enabled = False 
            .Enabled = True 
        End With 
    End Sub 
    
    
    Rory
    Theory is when you know something, but it doesnít work. Practice is when something works, but you donít know why. Programmers combine theory and practice: nothing works and they donít know why

  9. #9
    Join Date
    6th April 2011
    Posts
    74

    Re: ActiveX Combo box tutorials

    Ah rory, you save me again. Thank you very much as that fixes the whole issue. At least I learned alot about activex controls in the 3-4 days I used trying to get this thing to work. I want to cry now.

    Thanks!!

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. reseting focus and tabing out of activeX combo box
    By freekrob in forum EXCEL HELP
    Replies: 1
    Last Post: April 28th, 2011, 03:48
  2. Tutorials
    By Dave Hawley in forum Excel Resources With Search
    Replies: 0
    Last Post: May 8th, 2007, 19:53
  3. Activex Combo Box Format Text
    By New_to_VBA in forum EXCEL HELP
    Replies: 11
    Last Post: September 27th, 2006, 20:22
  4. References & Tutorials
    By jlaudie in forum EXCEL HELP
    Replies: 3
    Last Post: March 22nd, 2005, 06:47
  5. ActiveX Combo Box
    By Ghstnmachi in forum EXCEL HELP
    Replies: 2
    Last Post: May 28th, 2003, 17:37

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
  •  
porno