Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

2 easy questions :(

tijoentijoen Posts: 141Member
How can I use onmouseleave(or onmouseout, dunno) on a Timage?
I want to take out the title bar, but when I aximized with it(border = disabled) the start menu disapear, and I just want to take out the title bar, not the start menu from the programm

any tips plz?

Thanks
Jonathan

Comments

  • zibadianzibadian Posts: 6,349Member
    : How can I use onmouseleave(or onmouseout, dunno) on a Timage?
    : I want to take out the title bar, but when I aximized with it(border = disabled) the start menu disapear, and I just want to take out the title bar, not the start menu from the programm
    :
    : any tips plz?
    :
    : Thanks
    : Jonathan
    :
    There is no such event as a OnMouseLeave in any of the Delphi controls, but you can approximate it by using the TForm.OnMouseMove(), Mouse.CursorPos, and the TControl.BoundsRect. The latter two can be used to determine if the mouse is in the control.
    You can try to make the main menu into a toolbar, which has an alTop align. This should preserve the menu, with any border. If you do this, don't forget to remove the Form.Menu reference.
  • tijoentijoen Posts: 141Member
    [code]
    protected
    procedure WndProc(var Mesg : TMessage); override;

    procedure TFrmi3ClientMain.WndProc(var Mesg : TMessage);
    begin
    if Mesg.LParam = Longint(Image1) then
    begin
    if (Mesg.Msg = CM_MOUSELEAVE) then
    showMessage('testeeee');
    end;

    inherited WndProc(Mesg);
    end;
    [/code]

    this helped me out
    other question
    I want when the guy presses the key_numpad5, it doesn't come to my tmemo
    I go at the onkeydown of it and put this:
    [code]
    if (key = VK_NUMPAD5) then
    begin
    key := 0;
    exit;
    end
    [/code]
    but it doesn't happen, the number 5 still hit the memo
    but if I go at the keypress and put this
    if (key = '5') then Key := #0;
    it happen, the number 5 doesn't come, but it disable the number 5 above the letter as well, I only want to disable the number 5 at the numpad...
    Any tips?
    (sorry my poor english)

    Thanks
    Jonathan

    : : How can I use onmouseleave(or onmouseout, dunno) on a Timage?
    : : I want to take out the title bar, but when I aximized with it(border = disabled) the start menu disapear, and I just want to take out the title bar, not the start menu from the programm
    : :
    : : any tips plz?
    : :
    : : Thanks
    : : Jonathan
    : :
    : There is no such event as a OnMouseLeave in any of the Delphi controls, but you can approximate it by using the TForm.OnMouseMove(), Mouse.CursorPos, and the TControl.BoundsRect. The latter two can be used to determine if the mouse is in the control.
    : You can try to make the main menu into a toolbar, which has an alTop align. This should preserve the menu, with any border. If you do this, don't forget to remove the Form.Menu reference.
    :

  • zibadianzibadian Posts: 6,349Member
    : [code]
    : protected
    : procedure WndProc(var Mesg : TMessage); override;
    :
    : procedure TFrmi3ClientMain.WndProc(var Mesg : TMessage);
    : begin
    : if Mesg.LParam = Longint(Image1) then
    : begin
    : if (Mesg.Msg = CM_MOUSELEAVE) then
    : showMessage('testeeee');
    : end;
    :
    : inherited WndProc(Mesg);
    : end;
    : [/code]
    :
    : this helped me out
    : other question
    : I want when the guy presses the key_numpad5, it doesn't come to my tmemo
    : I go at the onkeydown of it and put this:
    : [code]
    : if (key = VK_NUMPAD5) then
    : begin
    : key := 0;
    : exit;
    : end
    : [/code]
    : but it doesn't happen, the number 5 still hit the memo
    : but if I go at the keypress and put this
    : if (key = '5') then Key := #0;
    : it happen, the number 5 doesn't come, but it disable the number 5 above the letter as well, I only want to disable the number 5 at the numpad...
    : Any tips?
    : (sorry my poor english)
    :
    : Thanks
    : Jonathan
    :
    : : : How can I use onmouseleave(or onmouseout, dunno) on a Timage?
    : : : I want to take out the title bar, but when I aximized with it(border = disabled) the start menu disapear, and I just want to take out the title bar, not the start menu from the programm
    : : :
    : : : any tips plz?
    : : :
    : : : Thanks
    : : : Jonathan
    : : :
    : : There is no such event as a OnMouseLeave in any of the Delphi controls, but you can approximate it by using the TForm.OnMouseMove(), Mouse.CursorPos, and the TControl.BoundsRect. The latter two can be used to determine if the mouse is in the control.
    : : You can try to make the main menu into a toolbar, which has an alTop align. This should preserve the menu, with any border. If you do this, don't forget to remove the Form.Menu reference.
    : :
    :
    :
    Here is a round-about way of stopping numpad keys, but it works.
    [code]
    var
    IsNumpad: boolean = false;

    procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
    Shift: TShiftState);
    begin
    IsNumpad := Key in [vk_Numpad0..vk_Numpad9];
    end;

    procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
    begin
    if IsNumpad and (Key ='5') then
    Key := #0;
    end;
    [/code]
Sign In or Register to comment.