Menu

(Win) Setting ComboBox height...

2003-02-06
2012-09-26
  • Nobody/Anonymous

    Theres no way to set the Height of a ComboBox?

    Im trying to set its dimensions  at CreateWindowEx like any other control but loos like the Height I set there is the height of the dropdown list, not the height of the combobox when it is closed :\

    Will I have to use a Owner Drawn ComboBox or am I missing something basic here?

     
    • Nobody/Anonymous

      Im trying to solve it since yesterday with absolutely no clue...doesnt anyone have  any idea that could help me?

      Thanks! And sorry for the bump...I know its a lame topic but im just unable to solve it by myself :(.

       
    • Nobody/Anonymous

      from what I've been able to find about it, the height of the edit portion of a combobox is determined by the font used,  couldn't find any suggestions on how to change it.

       
      • Nobody/Anonymous

        Thanks for replying :)
        I have already tried that. All the text on my app uses a very small font I created (CreateFont). The small font shows at all controls I SendMessage(...WM_SETFONT...) including the ComboBox, but that does not increases or decreases its height.

        Can you give me a link to where you read that? Maybe theres some other interesting info there.

         
        • Nobody/Anonymous

          Just a quick note on what i have tried to do in the past hour, dont laugh lol:

          wpcb1.length = sizeof(WINDOWPLACEMENT);
          GetWindowPlacement(hwndCB1,&wpcb1);
          if(sscanf(mainwndposition,"%ld,%ld,%ld,%ld",
                   & wp.rcNormalPosition.top,
                   & wp.rcNormalPosition.right,
                   & wp.rcNormalPosition.bottom,
                   & wp.rcNormalPosition.left)==4)
          wpcb1.rcNormalPosition.bottom=(wpcb1.rcNormalPosition.top+15);
          SetWindowPlacement(hwndCB1,&wpcb1);

          //Does not works but was worth a try right? ;-) 

           
          • Nobody/Anonymous

            //New Crap (which does not work too btw) 
            //PS: Im freaking :|

            COMBOBOXINFO cb1info;
            HWND hwndcb1edit;
            RECT cb1rcbutton;
            RECT cb1rcitem;

            cb1info.cbSize=sizeof(COMBOBOXINFO);
            GetComboBoxInfo(hwndCB1, &cb1info);
            cb1info.hwndItem=hwndcbedit;
            cb1info.rcButton=cb1rcbutton;
            cb1info.rcItem=cb1rcitem;

            cb1rcbutton.bottom=(cb1rcbutton.top+15);
            cb1rcitem.bottom=(cb1rcitem.top+15);

            UpdateWindow(hwndCB1);
            UpdateWindow(hwndCB1edit);

             
            • Nobody/Anonymous

              Finally :)

              In case someone ever searches the forum for this problem, heres the solution:

              LPMEASUREITEMSTRUCT lpmis;

              case WM_MEASUREITEM:
              lpmis = (LPMEASUREITEMSTRUCT) lParam;
              if (lpmis->itemHeight != 10) { //Heres the
              lpmis->itemHeight = 10;        //Height you want 
              }

               
    • Nobody/Anonymous

      don't remember... try searching on google

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.