private void buttonPendingPriceHelper_Click(object sender, EventArgs e) { Point location = ((Button)sender).Location; location.X -= 35; PriceHelpControl.ShowHelperControlAt(location, this, numericUpDownPendingPrice); }
/// <summary> /// Show the control at a given location. /// </summary> /// <param name="referenceControl">The control to use as location reference, must have parent to add this to.</param> public static void ShowHelperControlAt(Point location, Control parentControl, NumericUpDown sourceNumericControl) { if (sourceNumericControl.Enabled == false) { return; } PriceHelpControl control = new PriceHelpControl(sourceNumericControl); parentControl.Controls.Add(control); control.Location = location; control.BringToFront(); control.Focus(); }
private void buttonOpeningPricePriceHelper_Click(object sender, EventArgs e) { PriceHelpControl.ShowHelperControlAt(((Button)sender).Location, this, numericUpDownPendingPrice); }
private void buttonTakeProfitPriceHelper_Click(object sender, EventArgs e) { PriceHelpControl.ShowHelperControlAt(((Button)sender).Location, this, numericUpDownTakeProfit); }