Position der Form
-
Hallo rudpower,
ich meinte ja auch:
TPoint p = btn->ClientToScreen(Point(x, y));
wobei x und y die Koordinaten relativ zu deinem Button sind, z.B. rechts oben:
x = btn->Width; y = 0;
-
super so funktioniert es. Ich danke Euch vielmals. Hier die Funktion:
void __fastcall TfrmMain::btnSetV1Click(TObject *Sender) { //Forms werden passend zu den Button-Tags abgerufen und rechts neben Button positioniert TForm* frm[5] = {frmV1, frmP4, frmP2, frmP1, frmP3}; TLMDSpeedButton* btn = dynamic_cast<TLMDSpeedButton*>(Sender); if (NULL != btn) { POINT pt = btn->ClientToScreen(Point(btn->Width + 2, 0)); int tag = btn->Tag; frm[tag]->Left = pt.x; frm[tag]->Top = pt.y; frm[tag]->ShowModal(); } }