Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:24:26+00:00 2026-05-28T05:24:26+00:00

We have a WinForms control that is an extended version of ComboBox that supports

  • 0

We have a WinForms control that is an extended version of ComboBox that supports “cue banners” (aka watermarks) when there is no selection or text. Our control is similar to this implementation making use of CB_SETCUEBANNER.

However, when we set DropDownStyle for the control to ComboBoxStyle.DropDown (that is, also allows free text entry) the cue banner is showing, just not in italics (which is how it usually shows).

Does anyone know how to draw the cue banner in italics for a combo box in ComboBoxStyle.DropDown mode???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:24:27+00:00Added an answer on May 28, 2026 at 5:24 am

    By design. When the Style = DropDown, the text portion of the combobox is a TextBox. Which displays the cue banner in non-italic style. You can verify with this code. It is otherwise important to make the distinction between the banner and the actual selection visible when the Style = DropDownList, no doubt the reason they chose to display it italic. TextBox does it differently, it hides the banner when it gets the focus.

    Throwing in a non exhausting version:

    using System;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    
    class CueComboBox : ComboBox {
        private string mCue;
        public string Cue {
            get { return mCue; }
            set {
                mCue = value;
                updateCue();
            }
        }
        private void updateCue() {
            if (this.IsHandleCreated && mCue != null) {
                SendMessage(this.Handle, 0x1703, (IntPtr)0, mCue);
            }
        }
        protected override void OnHandleCreated(EventArgs e) {
            base.OnHandleCreated(e);
            updateCue();
        }
        // P/Invoke
        [DllImport("user32.dll", CharSet = CharSet.Unicode)]
        private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, string lp);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winforms TreeView control that allows you to browse an object hierarchy.
I have a WinForms user control Host with a custom UI Editor. Through that
I have a TreeView control in my WinForms .NET application that has multiple levels
I have created a WinForms user control that is a set of five cascading
I have a user control that is hosting a winforms listbox. I am re-sorting
I have a C# .NET 2.0 WinForms app. My app has a control that
I have a listview control that is on a winforms form. It fills the
I have a .NET Winforms web browser control that is rendering some application information,
I have a class that handles events from a WinForms control. Based on what
In my winforms app, I have a list view control that is populated with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.