問題タブ [toolstripmenu]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - Can you change font for ToolStripMenuItem in custom Renderer
I've got a menu with a custom Renderer:
Is there a way to change the font or perhaps make the menu item italic when moving the mouse over it?
I've got the event to change the background, but don't know about font / font color?
.net - VB .NET 多くの ToolstripMenuItems のチェックされたステータスを確認します
別のメニュー エントリをクリックしたときに、MenuStrip 内のメインの ToolStripMenuItem (MyMainMenu と呼ばれる) のすべてのメニュー項目のチェックを外したいと思います。メイン メニューには、いくつかのメニュー項目とセパレーターが含まれています。次のコードを試しました:
すべてのメニュー項目からそのコードを呼び出します (セパレーターを除く)。メニュー項目をクリックすると、ToolStripSeparator から ToolStripMenuItem にキャストできないというメッセージが表示されてプログラムがクラッシュします。同様の目的で同じコードが Microsoft .NET ドキュメンテーション サイトにありますが、同じメニュー項目に異なる種類の項目 (区切り記号、テキスト ボックスなど) が含まれている場合に何ができるかは指定されていません。
どうすればこの問題を解決できるか知っていますか?
ありがとう、
さよなら
vb.net - HOWTO: VB.NET で ToolStripMenuItem.DropDownItemClicked を使用する
他のドロップダウン項目を含むメニューである toolStripMenuItem があります。DropDownItemClicked イベントがドロップダウン項目の 1 つを選択することによって発生した場合、以下のように、いくつかの条件が満たされた場合にイベントを消費したいと思います。
問題は、DropDownItemClicked が実行する可能性を提供していないことです。
では、このイベントをどのように消費できますか?
c# - c#でtoolstripbuttonの選択されたインデックスを取得する方法
フォームにツールストリップ コントロールがあり、以下のコードを使用してツールストリップ コントロールにプログラムでボタンを追加します。
今、私はそれをクリックしたときにツールストリップボタンのインデックスを取得しようとしています
c# - C# 動的に追加された ToolStripMenuItems は、最小化すると消えます (C# Winforms)
私の Windows フォーム アプリケーションは、ユーザー アクセス権限を与えられた実行時にユーザー メニューを作成します。
正常に動作しますが、アプリを最小化すると、すべてのメニューが消えます。スペースは使用されていますが、名前とアイコンは表示されていません (最上位のメニュー項目が表示されていないため、明らかにサブメニューは表示されていません)。
クラスToolStripMenuItem
を使用してコーディングされており、以前はこのコードが設定されていました。
誰かがこの行動を見たことがありますか?
よろしく
ダニエル。
c# - MenuItem の色の変更
バックアップ ツールをプログラミングしています。ツールの上に、2 つの toolstripmenuitems を含むメニューストリップがあります。予想通り少し色を変えてみました。集中していないメニューは見栄えがします:
メニュー項目「ファイル」をクリックしてコンテキストメニューを開くと、色が白に変わり、テキストを読むことができなくなります。
どこでその動作を変更できるか教えてください。Visual Studio 2013 Ultimate、Windows Forms アプリケーション、コードは C# を使用しています。
コードは次のとおりです。
//
// initializing menuStrip1
//
this.menuStrip1.BackColor = System.Drawing.Color.MediumBlue;
this.menuStrip1.BackgroundImageLayout =
System.Windows.Forms.ImageLayout.Center;
this.menuStrip1.Font = new System.Drawing.Font("Segoe UI Semilight",
15.75F, System.Drawing.FontStyle.Regular,
///
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.MinimumSize = new System.Drawing.Size(0, 40);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1056, 40);
this.menuStrip1.TabIndex = 77;
this.menuStrip1.Text = "menuStrip1";
//
// initializing fileToolStripMenuItem and adding to menuStrip1
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new
System.Windows.Forms.ToolStripItem[] {
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem,
this.loadToolStripMenuItem});
this.fileToolStripMenuItem.Font = new System.Drawing.Font("Calibri Light",
15.75F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.fileToolStripMenuItem.ForeColor =
System.Drawing.SystemColors.ControlLightLight;
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(54, 36);
this.fileToolStripMenuItem.Text = "File";
this.fileToolStripMenuItem.Click += new System.EventHandler
(this.fileToolStripMenuItem_Click);
//
// initializing saveToolStripMenuItem and adding to fileToolStripMenuItem
//
this.saveToolStripMenuItem.BackColor = System.Drawing.Color.MediumBlue;
this.saveToolStripMenuItem.ForeColor =
System.Drawing.SystemColors.ControlLightLight;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(166, 30);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler
(this.saveToolStripMenuItem_Click);