?
Solved

How to disable mouse wheel when TComboBox has focus

Posted on 2003-03-18
3
Medium Priority
?
1,927 Views
Last Modified: 2010-04-06
I have a form with a combobox and a twebbrowser - I want the mouse wheel to work only if the twebbrowser is active - how can this be done?

Thank you.
0
Comment
Question by:moonrise
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
DaFox earned 1000 total points
ID: 8161086
Hi moonrise!

Try this:

type
  TComboBox = class(StdCtrls.TComboBox)
  protected
    procedure ComboWndProc(var Message: TMessage; ComboWnd: hWnd; ComboProc: Pointer); override;
  end;

  TForm1 = class(TForm)
    ComboBox1: TComboBox;
  private

...

procedure TComboBox.ComboWndProc(var Message: TMessage; ComboWnd: HWnd; ComboProc: Pointer);
begin
  if (WebBrowserNotActive and ((Message.Msg = WM_VSCROLL) or (Message.Msg = WM_HSCROLL) or (Message.msg = WM_Mousewheel))) then Message.Msg := 0;
  inherited;
end;

Markus
0
 

Author Comment

by:moonrise
ID: 8161422
works great, thank you
0
 
LVL 6

Expert Comment

by:DaFox
ID: 8162501
You're welcome. Thanks for the points.

Markus
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month13 days, 3 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question