TextBox Winforms

We have created a user control form having a slider and a Text Box. This user control form is passed into a rhino panel.
When the panel is floating in Rhino, the keypress event for the textbox works correctly.
When the same panel is Docked, slider scroll events and Label double click events work correctly.
However, the keypress event doesn’t fire.
We have already tried keydown event as written in some other post…

Any fix for this?

Writing the sample code below.

private void bridgeRail_DoubleClick(object sender, EventArgs e)
{
    bridgeRailEdit = !bridgeRailEdit;
    ToggleLabelTextBox(bridgeRailEdit, bridgeRailLabel, bridgeTextBox);
    double newValue;
    if (double.TryParse(bridgeTextBox.Text, out newValue))
    {
        bridgeRailDistance = newValue;
        bridgeRailDistanceSlider.Value = (int)(newValue * 100);
        UpdateBridgeRail();
    }
}

private void bridgeRail_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar == (char)Keys.Enter)
    {
        bridgeRail_DoubleClick(sender, e);
    }
    RhinoDoc doc = RhinoDoc.ActiveDoc;
   
    );
}

Resolved - Used KeyUp