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プロパティを設定するtrueかfalse、条件に応じて (チェック ユーザー)、非表示または表示します。
Visible
true
false
if(someConditionExpressionHere) { btnSave.Visible=true; } else { btnSave.Visible=false; }
非表示/表示するボタンのIDであると仮定btnSaveします。someConditionExpressionHereユーザーが管理者か通常のユーザーかを確認するには、チェックを付けて更新する必要があります。
btnSave
someConditionExpressionHere