Solved

Notify Message Event Handling

Posted on 1999-01-19
5
737 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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