Solved

Notify Message Event Handling

Posted on 1999-01-19
5
729 Views
Last Modified: 2012-06-27
Hi!
I have a combobox and I want to create an event handler for it's cbn_selendok notify message.
(I want to be able to write a procedure that will execute when the user selects an item from the combo just like when you select url's from netscape's or explorer's url combo and sent there)
I tried a few things but I can't say for sure that I'm on the right direction...
can anyone clear that up for me?
thanks!
0
Comment
Question by:Yoni
  • 3
5 Comments
 
LVL 4

Expert Comment

by:itamar
Comment Utility
Hi Yoni,

I think I´m missing smth. What about the OnChange event ? What do you need to acomplish that OnChange doesn´t provide ?

bye,
Itamar
0
 

Author Comment

by:Yoni
Comment Utility
because I need the text of the last Item selected. onchange updates if I write things after I selected the Item. That's why I need to get the combobox text exactly after the item has been selected...
0
 

Author Comment

by:Yoni
Comment Utility
because I need the text of the last Item selected. onchange updates if I write things after I selected the Item. That's why I need to get the combobox text exactly after the item has been selected...
0
 
LVL 3

Accepted Solution

by:
Matvey earned 30 total points
Comment Utility
Yoni, put two combos and a memo on a form, and copy this:
_________________________________________________________________________
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Memo1: TMemo;
  protected
    procedure WndProc(var Message: TMessage); override;
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.WndProc(var Message: TMessage);
begin
  //if the message is sent, we put a line in the momo...

  if (Message.Msg = WM_COMMAND) and (Message.WParamHi = CBN_SELENDOK) then
    memo1.lines.add('CBN_SELENDOK, combo handle: '+inttostr(Message.LParam));
  inherited WndProc(Message);
end;

end.
_________________________________________________________________________

That's about it. Good luck
--Matvey
0
 

Author Comment

by:Yoni
Comment Utility
Great! it works!
thanks matvey!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now