?
Solved

Notify Message Event Handling

Posted on 1999-01-19
5
Medium Priority
?
738 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 120 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
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…
Suggested Courses

765 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