Solved

Notify Message Event Handling

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

Technology Partners: 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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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