Wie Mauszeiger positionieren?
-
Hallo! Eine Frage tat sich bei mir auf, deshalb frage ich hier mal
Ist es möglich den Cursor der Maus auf z.B. ein Memofeld / Editfeld zu positionieren oder kann man das nur über die Werte x/y? 
-
Hallo
Wo ist das Problem? Position des Controls bestimmen, gegebenfalls über einfache geometrische Funktionen die Mitte des Control berechnen und fertig.
bis bald
akari
-
Was spricht jetzt gegen SetCursorPos? Die Position der Komponente kann man sich problemlos ausrechnen...
//Edit: zu spät. Und das um diese Uhrzeit
-
Danke für die Vorschläge aber ich meinte ob man direkt das Memofeld angeben kann? z.B. Positioniere Cursor auf Memofeld1 in der mitte...
Geht das? Oder muss man das immer mit den x und y koordinaten machen?
-
Auf die Schnelle:
Da sich das Memo sicher immer an der selben Stelle im Form befindet
SetCursorPos(Screen->Width / 2, Screen->Height / 2);Für den fall das dein Memo sich in der Mitte des Fensters befindet...
MfG
TippoEdit: Jetzt tu sich mir auch noch eine Frage zum Thema auf. In der BCB Hilfe steht folgendes:
IOTAEditView40::SetCursorPos
virtual void __fastcall SetCursorPos(const TOTAEditPos &Value) = 0;Description
SetCursorPos is the write implementation of the CursorPos property.
Value is the new cursor position.
TOTAEditPos type
struct TOTAEditPos { short Col; int Line; };The TOTAEditPos type represents a visual editor position.
The Col field is the column number. The leftmost column is one. Tab characters are expanded, and an edit position can refer to a virtual position within the expansion of a tab character.
The Line field is the line number. The first line number of a file is one.
Kann man das so direkt auf Memo anwenden?