Skip to content

Commit 0ca60da

Browse files
author
Elias Ruemmler
committed
Auto-clear old user inputs
1 parent 2cde8a4 commit 0ca60da

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

FlowCalc/PipeCalcView.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public PipeCalcView()
4141
{
4242
InitializeComponent();
4343

44-
this.Text = WindowTitle + " - p-v-Q"; //Title
44+
this.Text = WindowTitle + " - Druckabfall"; //Title
4545
this.Icon = Properties.Resources.iconfinder_100_Pressure_Reading_183415;
4646

4747
cmb_FlowRateUnit.ValueMember = nameof(DisplayUnit.DisplayName);
@@ -193,14 +193,22 @@ private void cmb_DeltaPUnit_SelectedIndexChanged(object sender, EventArgs e)
193193

194194
private void txt_FlowVelocity_TextChanged(object sender, EventArgs e)
195195
{
196-
//if (!m_CalculationActive && !string.IsNullOrWhiteSpace(txt_FlowRate.Text))
197-
// txt_FlowRate.Clear();
196+
//if (!m_CalculationActive && !string.IsNullOrWhiteSpace(txt_FlowRate.Text))
197+
if (sender == ActiveControl && !string.IsNullOrWhiteSpace(txt_FlowRate.Text))
198+
{
199+
txt_FlowRate.Clear();
200+
txt_DeltaP.Clear();
201+
}
198202
}
199203

200204
private void txt_FlowRate_TextChanged(object sender, EventArgs e)
201205
{
202-
//if (!m_CalculationActive && !string.IsNullOrWhiteSpace(txt_FlowVelocity.Text))
203-
// txt_FlowVelocity.Clear();
206+
//if (!m_CalculationActive && !string.IsNullOrWhiteSpace(txt_FlowVelocity.Text))
207+
if (sender == ActiveControl && !string.IsNullOrWhiteSpace(txt_FlowVelocity.Text))
208+
{
209+
txt_FlowVelocity.Clear();
210+
txt_DeltaP.Clear();
211+
}
204212
}
205213
}
206214
}

0 commit comments

Comments
 (0)