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 8021013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:51:06+00:00 2026-06-04T21:51:06+00:00

I am using a SearchCtrl with a dropdown menu and I’m having some trouble

  • 0

I am using a SearchCtrl with a dropdown menu and I’m having some trouble with the events. When I click the little arrow screenshot searchctrl next to the search button, the EVT_SEARCHCTRL_SEARCH_BTN is triggered, which is not what I want. I only want the EVT_MENU_RANGE to be triggered after I clicked an item, and not also the EVT_SEARCHCTRL_SEARCH_BTN before i click it.

self.search_ctrl = wx.SearchCtrl(self.panel_1, -1,
                                 style=wx.TE_PROCESS_ENTER)
self.search_menu = wx.Menu()
self.search_items = {"text1":"value1", "text2":"value2"}
for txt in self.search_items:
    self.search_menu.Append(-1, txt)
self.search_ctrl.SetMenu(self.search_menu)
self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.search, self.search_ctrl)
self.Bind(wx.EVT_MENU_RANGE, self.onSearchMenu)

Although I should probably add id’s to the menu bind, this isn’t causing the problem. The code works as expected when I comment out the search button bind.

UPDATE
Apparently this isn’t a problem, but a ‘feature’ of the searchctrl. I tried the wxpython demo and the menu also showed up if I just clicked the search button, and not the arrow. It is apparently one button, instead of the two i thought it was.
Is there a way to accomplish my original request? Do i have to manually modify a textctrl, or is there an other solution?

  • 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-06-04T21:51:08+00:00Added an answer on June 4, 2026 at 9:51 pm

    All the examples I’ve seen suggest you need to specify a range of IDs when you call your menu bind.

    Maybe by default it binds to something unexpected… ?

    Edit – In light of your update, it seems likely that you’re going to need to make a custom control to me..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having this weird problem with HtmlUnit in Java. I am using it to
I currently have a click event in place that when selected appends a search
Situation: Hello! I have a little problem in a C# project. I am using
Using VB6 I am using checkbox and combobox in a Form. When i click
I'm using Jörn Zaefferers autocomplete plugin for jQuery to enable a live search field,
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
I am having an issue with getting a Multiple search working with a IQueryable.Where
Using Rails 3.1. I have some pages that render same layout, except the contents
(Using WPF) In a small application that I wrote, I am using some count-down
Using LINQ on collections, what is the difference between the following lines of code?

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.