简体   繁体   中英

Xamarin.Mac TextBox Update

I have a form with a TextBox and a Label. My goal is to auto-update the label to the value of the TextBox each time I change something.

I know that in the .NET Framework there is a "TextChange" Event, which worked. But somehow I am not able to recreate this with with Visual Studio for Mac.

Use the Changed event and set the label's StringValue to the text field's StringValue:

nstextfield.Changed += (sender, e) =>
{
    label.StringValue = nstextfield.StringValue;
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM