Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
Old 04-27-2018, 06:34 AM
rmt rmt is offline
Senior Member
Join Date: Jun 2013
Posts: 286
Default Delphi5: Show Caps Lock Warning Message.

Dear Expert,

I would like to show capslock warning message on LogId exit event in my dephi application if CapsLock is on. I used below code to show respective message but I want to show the message as shown in file attached here.

if Odd(GetKeyState(VK_CAPITAL)) //tests if caps lock is on
then showmessage('caps lock is on');

Thanks in advance,
Attached Images
File Type: png TestCapsLock.png (13.3 KB, 6 views)
Reply With Quote
Old 04-30-2018, 11:44 AM
Norrit Norrit is offline
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,310

This is not a default Delphi/Windows implementation as far as I know

You could enhance your TEdit with a OnWarning (similar to OnHint) and implement it. Here you can also see how OnHint does this. Or if you're lazy just use the OnHint and enhance it's output a little.
Problem with ShowMessage (any message dialog for that matter) is that you must click it away to proceed and then the visual indiciation is lost.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 04:10 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.