Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コントロールのブール プロパティをブール アプリケーション設定とは逆にバインドする方法は?
たとえば、ボタンの「Visible」プロパティを「!Flag」にバインドしたい場合、その「Flag」はアプリケーション設定のブール フィールドです。
ApplicationSetting バインディングでは、値に式を適用できません。簡単な解決策は、Button から独自のコントロールを派生させることです。例えば:
using System; using System.Windows.Forms; class MyButton : Button { public bool Invisible { get { return !Visible; } set { Visible = !value; } } }