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#
  4. ComboBox Event

ComboBox Event

Scheduled Pinned Locked Moved C#
tutorial
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.
  • Z Offline
    Z Offline
    zaboboa
    wrote on last edited by
    #1

    Hello, I have a combobox, which is a DropDownList (can't type inside the box) with values: a, b, and c for example. Is there an event, that will be triggered only when the text changed, if value of combobox was a and new value is b, fire event. However, if value was a and user picks a again, don't fire event. Thank you.

    M 1 Reply Last reply
    0
    • Z zaboboa

      Hello, I have a combobox, which is a DropDownList (can't type inside the box) with values: a, b, and c for example. Is there an event, that will be triggered only when the text changed, if value of combobox was a and new value is b, fire event. However, if value was a and user picks a again, don't fire event. Thank you.

      M Offline
      M Offline
      maheswara
      wrote on last edited by
      #2

      DropDown event Occurs when the drop-down portion of a ComboBox is shown. we can use the event when the text changed in the combobox. This event is raised if the Text property is changed by either a programmatic modification or user interaction. private void currencyTextBox_TextChanged(object sender, EventArgs e) { try { // Convert the text to a Double and determine if it is a negative number. if(double.Parse(currencyTextBox.Text) < 0) { // If the number is negative, display it in Red. currencyTextBox.ForeColor = Color.Red; } else { // If the number is not negative, display it in Black. currencyTextBox.ForeColor = Color.Black; } } catch { // If there is an error, display the text using the system colors. currencyTextBox.ForeColor = SystemColors.ControlText; } } mahes

      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