CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    Czech Republic
    Posts
    1

    Problem with ComboBox control embedded into an ActiveX control.

    I tried to build an ActiveX control with a ComboBox control embedded. The problem is that the ComboBox is not drawn properly in the inactive state (the control try to redraw the entire area of dropped-down rectangle and the result is a flicker image). The same behavior is mentioned (as a bug) by Adam Denning in his book “ActiveX Controls Inside Out” 2nd edition Microsoft Press 1997, chapter 10, page 328. Unfortunately he forgot to explain how to get rid of this trouble.

    Can anyone tell me what can be the cause of this problem ?

    Thanks,
    Max.



  2. #2
    Join Date
    May 1999
    Location
    Lssol
    Posts
    68

    Re: Problem with ComboBox control embedded into an ActiveX control.

    I assumed you use the following code to set the height of the listbox.
    You have to do this just ONE time !!!


    if( nCtlColor == CTLCOLOR_LISTBOX )
    {
    CRect rect;
    pWnd->GetWindowRect(&rect);
    if (rect.Height() < 150 )
    {
    rect.bottom = rect.top + 151;
    pWnd->MoveWindow(&rect);
    }
    }





    Maybe you have time to help me !!!
    Please read this !!!

    -------------------------------------------------
    Problems with a ComboBox subclassing in a ActiveX

    I need a ComboBox control that when activating will load a database in it.
    My problem IS NOT related to database but to the ComboBox.
    My problems are:
    - in what message to load the databese?
    I have done this in OnShowWindow() but when I design the dialog (or where it have the be the control) I have to wait for the ComboBox to load the database
    - I have to set the drop down height (of the ListBox). I've done this in OnCtlColor():

    if( nCtlColor == CTLCOLOR_LISTBOX )
    {
    CRect rect;
    pWnd->GetWindowRect(&rect);
    if (rect.Height() < 150 )
    {
    rect.bottom = rect.top + 151;
    pWnd->MoveWindow(&rect);
    }
    }



    BUT IT'S NOT WORKING TOO MUCH.
    The ListBox is visible just for like one second on first drop down message !!
    On second message is OK, on third again it disapears, and so on ...

    And something else !!!
    When I use 2 (or more) ComboBoxes like this on a dialog:
    - drop down on first ComboBox -> OK
    - drop down on second ComboBox -> OK
    - drop down on first ComboBox again -> !? -> the ListBox has 0 height!! WHY?


    - the ListBox control does not have a scroll bar. How to set the ListBox to have a scroll bar?

    Maybe you can help me (with a source code?)

    http://www.xoom.com/olixx
    [email protected]

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

Featured