Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Combobox..

Combobox..

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kumar sanghvi
    wrote on last edited by
    #1

    Hi, im creating combobox ctrl Thru code but not from resource...and Pls let me know how can i increase the height of the ctrl based on the font...ie if the font is small ctrl should be small else if the Font is bigger Ctrl should increase.... i used SetFont() but it doesn"t help... and even i tried using GetComboBoxInfo and obtained HWND hwndItem,HWND hwndList; handles for Editbox and drop-down list but i want to know how can i setfont for the same...

    B 1 Reply Last reply
    0
    • K kumar sanghvi

      Hi, im creating combobox ctrl Thru code but not from resource...and Pls let me know how can i increase the height of the ctrl based on the font...ie if the font is small ctrl should be small else if the Font is bigger Ctrl should increase.... i used SetFont() but it doesn"t help... and even i tried using GetComboBoxInfo and obtained HWND hwndItem,HWND hwndList; handles for Editbox and drop-down list but i want to know how can i setfont for the same...

      B Offline
      B Offline
      Bacon Ultimate Cheeseburger
      wrote on last edited by
      #2

      SetFont() will not automatically change the size of the combo box. You can use GetTextMetrics() to obtain size information about about the font, calculate the minimum size necessary to display the font in the control and then manually adjust the size and position of the combobox.

      I am a lean mean ground beef machine!!!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups