Solved

Notify Message Event Handling

Posted on 1999-01-19
5
736 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
[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
  • 3
5 Comments
 
LVL 4

Expert Comment

by:itamar
ID: 1362448
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
ID: 1362449
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
ID: 1362450
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
ID: 1362451
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
ID: 1362452
Great! it works!
thanks matvey!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SUM 2 INTEGER ARRAYS INTO 1 10 117
Adoquery sql  left join does not work 25 119
Twebbrowser add css to the header 3 53
firemonkey Android Listview Sort items 7 102
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

732 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