Why is my tlistbox requiring me to double up my ampersands?

Peter Turner

Is there a way to make it so you don't have to double up your &'s to make Delphi list box not register them as hotkeys?

We've got a list of drug names that we populate in a ListBox, some of the drugs have &'s in them like "A & D Ointment", well it's kind of dumb to have "A _D Ointment" show up so we double up the &&'s to make it "A & D Ointment" the only problem is, when we do that we can't us the text in the list box for anything useful without re-unconverting the text.

It would be must more convenient for us to just turn off the hotkey thing altogether which I can't seem to find a way to do with the IDE, but I'm sure there's some fancy windows message to override this (hopefully I don't have to override the base class)


We're overriding the DrawItem function using:

DrawText(List.Canvas.Handle, PChar(List.Items.Strings[Index]), -1, Rect, DT_VCENTER);
Darin Ballweg

You're probably not using the default TListBox draw function if this is happening as by default it uses DT_NOPREFIX to draw things.

Check and make sure you're not overriding the DrawItem function to see if use DrawText without DT_NOPREFIX. If you use DT_NOPREFIX, then your text will remain the same.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

why does my float variable statement keeps on giving me an 'Cannot implicitly convert type double to float' error?

분류에서Dev

Why is my Makefile giving me problems?

분류에서Dev

Why is sudo telling me my password is wrong?

분류에서Dev

help me set up drivers to my Epson printer

분류에서Dev

Why does my corner-widget not show up in QTabWidget?

분류에서Dev

Don't understand why my code giving me an IndexError

분류에서Dev

Why do some of my devices show up twice on my routers DHCP list?

분류에서Dev

Why does devise me redirect me to /users instead of /users/edit when my account update fails?

분류에서Dev

why my case give me the errors?Why i can't put variables in switch cases?

분류에서Dev

Cleaning up my Home Directory

분류에서Dev

What waked up my computer?

분류에서Dev

messed up my system python

분류에서Dev

Why is my TextBox not binding?

분류에서Dev

Why is my GPU overheating?

분류에서Dev

Why is my clearfix not working?

분류에서Dev

Why won't my Android SDK Manager show up when invoked from Eclipse?

분류에서Dev

Why isn't my second HDMI alsa_output being detected at start-up?

분류에서Dev

Why does my Windows 7 computer freeze after waking up from Sleep?

분류에서Dev

Why do '' show up as ' (HTML Entity?) in my charts.js.erb file?

분류에서Dev

Why is there an ever-growing uvcydnctrl-udev.log file filling up my harddisk?

분류에서Dev

Why is there an ever-growing uvcydnctrl-udev.log file filling up my harddisk?

분류에서Dev

Perl "\my $var" why is the "my" escaped with a backslash?

분류에서Dev

Why does my Xcode compiler tell me I use a value type even though I use classes?

분류에서Dev

Why my jdk can't work,and before the java_home, there is a space that is not from me

분류에서Dev

Why does updating Oh My Zsh give me an error about rebasing with unstaged changes?

분류에서Dev

How can I dual boot Ubuntu and Windows 10 but have my PC boot into windows without prompting me at start up

분류에서Dev

How to back up my entire system?

분류에서Dev

Python is taking up all of my CPU!

분류에서Dev

What is up with my Vi/Vim installation?

Related 관련 기사

  1. 1

    why does my float variable statement keeps on giving me an 'Cannot implicitly convert type double to float' error?

  2. 2

    Why is my Makefile giving me problems?

  3. 3

    Why is sudo telling me my password is wrong?

  4. 4

    help me set up drivers to my Epson printer

  5. 5

    Why does my corner-widget not show up in QTabWidget?

  6. 6

    Don't understand why my code giving me an IndexError

  7. 7

    Why do some of my devices show up twice on my routers DHCP list?

  8. 8

    Why does devise me redirect me to /users instead of /users/edit when my account update fails?

  9. 9

    why my case give me the errors?Why i can't put variables in switch cases?

  10. 10

    Cleaning up my Home Directory

  11. 11

    What waked up my computer?

  12. 12

    messed up my system python

  13. 13

    Why is my TextBox not binding?

  14. 14

    Why is my GPU overheating?

  15. 15

    Why is my clearfix not working?

  16. 16

    Why won't my Android SDK Manager show up when invoked from Eclipse?

  17. 17

    Why isn't my second HDMI alsa_output being detected at start-up?

  18. 18

    Why does my Windows 7 computer freeze after waking up from Sleep?

  19. 19

    Why do '' show up as ' (HTML Entity?) in my charts.js.erb file?

  20. 20

    Why is there an ever-growing uvcydnctrl-udev.log file filling up my harddisk?

  21. 21

    Why is there an ever-growing uvcydnctrl-udev.log file filling up my harddisk?

  22. 22

    Perl "\my $var" why is the "my" escaped with a backslash?

  23. 23

    Why does my Xcode compiler tell me I use a value type even though I use classes?

  24. 24

    Why my jdk can't work,and before the java_home, there is a space that is not from me

  25. 25

    Why does updating Oh My Zsh give me an error about rebasing with unstaged changes?

  26. 26

    How can I dual boot Ubuntu and Windows 10 but have my PC boot into windows without prompting me at start up

  27. 27

    How to back up my entire system?

  28. 28

    Python is taking up all of my CPU!

  29. 29

    What is up with my Vi/Vim installation?

뜨겁다태그

보관