I see my version of delphi, doesn't have Key Events(OnKeyDown, OnKeyUp, OnKeyPress) events for TPaintBox. I would like to process something like that. Had somebody a paintbox with these events?
I need Key Events for TPaintBox
2.6k Views Asked by user558126 At
2
There are 2 best solutions below
Related Questions in DELPHI
- How to not load all database records in my TListbox in Firemonkey Delphi XE8
- How to catch WM_DEVICECHANGE in a control other than TForm?
- show information with Rolling / moving messages delphi xe7
- What is the different between "Console target" and "GUI target" in DCC32 option?
- How to add new online ressources to RAD Studio help system
- C# and Delphi code have different behaviour when importing unmanaged dll
- Loop through records on a cxgrid and update a field/column
- Delphi 7 - Save to a Specific .INI Files Name
- TImagelist for large images
- how to modify a function so it returns an array of strings
- Checking for internet connection in runtime
- How can I make the main form align correctly after my control height is autosized and then I maximize the form?
- fetch data from web service to dataset in Delphi
- Load candlestick data from file
- Infinite loop in parsing a string using pointer math
Related Questions in EVENTS
- OpenLayer 3: Map pointer up event can not be triggered when the map created on overlay
- Angular scroll directive
- Setting multiple events in one ext.net button
- Detect if Application was suspended in OnNavigatedFrom for Windows Phone 8
- When in click a radio button, it scroll to the top. How to prenvent that?
- Event subscribed but null in child class (after threads initialize)
- How to get results each sec from "perf stat -d sleep 1000"
- How to register event for TextBox end editing
- Stop the installshield installation if a file is not found in vb.net
- How to capture the next event based on a condition
- Flask server to notify webclient when changes occur
- Google analytics event tracking, retrieve results
- What is the correct way to code event handlers for serializable model objects?
- Android version of NSNotificationCenter (event binding)
- Center JoptionPaneMessageDialog in parent element of the source element that generated the event
Related Questions in KEY
- Android Signature key differences between Old and New PC
- Java HashMap, hashCode() equals() - how to be consistent with multiple keys?
- Kaltura account settings error
- fetch json value with no key using jquery
- C++ Custom std::map<> key class causing memory violation
- How do I use php file() to access an array and echo specific keys?
- constructing key by bit shifting 3 integers in C
- How to get keystrokes with java outside of frames
- Keys in Perl hash disappeared
- Master Array compare csv
- Covering index and getting rid of Key Lookup
- How to add key pairs to object literals using loop--WITHOUT overriding existing entries?
- PHP Convert Array Including Key Rename
- Python: How to append to existing key of a dictionary?
- Python key error - for key in dictionary: dictionary[key]
Related Questions in PAINT
- When is Datagridview's Paint and Cellpainting called?
- try to combine all line of texts which have different format in one bitmap
- Making Standard Dial Range on JFreeChart thicker
- Draw things after board is drawn with paint (JPanel) (java)
- Java Paint and JButton
- how to override the paint method without stopping its functionality
- Various paint objects in Activity
- Clear Transparent Background for QWidget
- Android SurfaceView: textsize changing in Paint is not smooth
- The method paint(Graphics g) of JComponent does not see the field
- Use keyListener to update paint().
- Android Canvas focus in selected area
- Carousel slider with description below changing
- Java swing Button is invisible after revalidate() until clicked
- Python Recursion Function Causes Pygame to Freeze
Related Questions in PAINTBOX
- Dragging a TPaintBox while keeping its content static
- paintbox doesnt paint from timer method c++ builder borland
- erase line from paintbox borland c++ builder
- I need Key Events for TPaintBox
- How make the same hole in two Form's on remote screen (client side), based on area drawn on server side?
- How to eliminate the flicker on the right edge of TPaintBox (for example when resizing)
- Delphi - TPaintBox - Resize
- Delphi FMX Android FillText is Slow and Resource intensive
- How draw a rectangle/hole in a "Form3" using coordinates of a PaintBox present in "Form2"?
- Best practice regarding plotting graph data
- Problem with creating tpaintbox on tpanel
- How to draw a line in Delphi on an FMX canvas
- Delphi: Export/Draw TPaintbox straight to file with custom image size
- Delphi XE5 - TPaintBox scrolls too slow under TListBox on machines with Android
- Painting TPaintBox during Drag&Drop with DragImage
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Like TLama said, you'll need to inherit from TCustomControl. But you'll need some additional code to publish all keyboard events. You could choose the easy way and inherit from TPanel since TPanel already exposes a Canvas and a number of keyboard events.
But here's some code to show how to create and register a new control that published the properties of TCustomControl and introduces a new OnPaint event:
If you create a new Package, add this unit, and install it, you will have a new TGTPaintBox control that can have the focus (although you don't see it). It can retrieve keyboard input too.
I've added some functionality in an attempt to make the control transparent, because a PaintBox is too. One disadvantage is that you need to repaint the parent to clear the previously drawn content. In the demo application this is easy enough. I just invalidate the form instead of the control. :p
If you don't need it, you can remove
WMEraseBkGnd,CreateParamsandSetParentfrom the control.Small demo: Put a label on a form. Put a TGTPaintBox on top of it and make it a bit larger. Then add a timer, and maybe some other controls.
Make sure you set the TabStop property of the GTPaintBox to
True.Then, implement the following events;