Use the property
TextBox.Text
, it is a read/write property.
You need not do anything else if you "assign some value" to
NumericUpDown
. It won't work if the user changes the value of
NumericUpDown
; in this case, handle the event
NumericUpDown.ValueChanged
; in the body of the handler, assign the value of
ValueChanged.Value.ToString()
to
TextBox.Text
.
NumericUpDown myUpDown = new NumericUpDown();
TextBox myTextBox = new TextBox();
myUpDown.ValueChanged += (sender, eventArgs) => {
myTextBox.Text = myUpDown.Value.ToString();
}
—SA