mcpField
S
syncfusion-winforms-fontlistbox

syncfusion-winforms-fontlistbox

github.com/syncfusionデザイン・UI278 回インストール1 週間前に更新
リポジトリ

syncfusion-winforms-fontlistbox について

Windows Forms アプリケーションで Syncfusion FontListBox を実装するためのスキルです。インストール済みフォントを一覧表示し、選択モード、入力による検索、スクロールバー、ビジュアルスタイルに対応します。

主な機能

  1. 01インストール済みフォントの自動一覧表示
  2. 02単一・複数選択モード
  3. 03入力によるフォント名検索
  4. 04並べ替えと項目の高さ設定
  5. 05スクロールバーとビジュアルスタイルの設定

活用シーン

  1. 01テキストエディター用フォント選択機能の作成
  2. 02複数フォントの選択
  3. 03入力によるフォント名の検索
  4. 04選択したフォントの別コントロールへの適用

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/syncfusion/winforms-ui-components-skills --skill syncfusion-winforms-fontlistbox

インストール後、Claude Code で/syncfusion-winforms-fontlistboxを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

references/
customization-and-behavior.md
getting-started.md
visual-styles.md

詳細

Syncfusion WinForms FontListBox コントロールの実装

Syncfusion の FontListBox(Syncfusion.Windows.Forms.Tools.FontListBox)は、ユーザーのシステムにインストールされているすべてのフォントを自動的に表示する、ListBox 派生コントロールです。複数の選択モード、入力文字列に一致する項目を検索するオートコンプリート、水平スクロールバー、項目の高さの調整、Office スタイルのビジュアルテーマに対応しています。

このスキルを使用する場面

次のような場合に、このスキルを使用します。

  • インストール済みのシステムフォントを一覧表示する — 作成時に自動的に一覧が表示されます
  • ユーザーがフォントを選択できるようにする — 選択したフォントをラベル、テキストボックス、またはその他のコントロールに適用します
  • 選択モードを設定する — 単一選択、複数選択(単純)、または複数選択(拡張)
  • 入力文字列に一致する項目を検索するオートコンプリートを有効にする — UseAutoComplete
  • Office のビジュアルスタイルを適用する — FontListBoxStyle 列挙型を使用した VisualStyle
  • スクロールバーの表示を制御する — HorizontalScrollbar、ScrollAlwaysVisible
  • フォント選択イベントを処理する — SelectedIndexChanged

コンポーネントの概要

プロパティ型説明
SelectionModeSelectionModeOne、MultiSimple、または MultiExtended
UseAutoCompletebool入力に応じてリスト内の項目を検索
Sortedboolフォント名をアルファベット順に並べ替えます
ItemHeightint各リスト項目の高さ(ピクセル単位)
HorizontalScrollbarbool項目が収まらない場合に水平スクロールバーを表示します
HorizontalExtentint水平スクロールバーが有効な場合のスクロール可能領域の幅(ピクセル単位)
ScrollAlwaysVisiblebool項目数にかかわらずスクロールバーを表示したままにします
VisualStyleFontListBoxStyleOffice/Metro のビジュアルテーマ

ドキュメントとナビゲーションガイド

はじめに

📄 参照: references/getting-started.md

  • アセンブリ参照と NuGet パッケージの設定
  • デザイナーまたはプログラムから FontListBox を追加する方法
  • システムフォントの自動表示
  • SelectionMode — None、One、MultiSimple、MultiExtended
  • SelectedIndexChanged を処理して、別のコントロールにフォントを適用する方法
カスタマイズと動作

📄 参照: references/customization-and-behavior.md

  • ItemHeight — フォント項目ごとの行の高さ
  • Sorted — フォント名をアルファベット順に並べ替え
  • UseAutoComplete — ユーザーの入力に応じて一致する項目を検索
  • HorizontalScrollbar と HorizontalExtent
  • ScrollAlwaysVisible — スクロールバーを常に表示する設定
ビジュアルスタイル

📄 参照: references/visual-styles.md

  • FontListBoxStyle 列挙型を使用する VisualStyle プロパティ
  • 使用可能なスタイル:Default、Metro、Office2016Colorful、Office2016White、Office2016Black、Office2016DarkGray

クイックスタート

C#:

using Syncfusion.Windows.Forms.Tools;

FontListBox fontListBox1 = new FontListBox();
fontListBox1.Size = new System.Drawing.Size(160, 94);
fontListBox1.UseAutoComplete = true;
fontListBox1.SelectionMode = System.Windows.Forms.SelectionMode.One;
fontListBox1.SelectedIndexChanged += FontListBox1_SelectedIndexChanged;
this.Controls.Add(fontListBox1);

private void FontListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    label1.Font = new System.Drawing.Font(
        fontListBox1.SelectedItem.ToString(), 11, System.Drawing.FontStyle.Regular);
}

VB.NET:

Imports Syncfusion.Windows.Forms.Tools

Dim fontListBox1 As New FontListBox()
fontListBox1.Size = New System.Drawing.Size(160, 94)
fontListBox1.UseAutoComplete = True
fontListBox1.SelectionMode = System.Windows.Forms.SelectionMode.One
AddHandler fontListBox1.SelectedIndexChanged, AddressOf FontListBox1_SelectedIndexChanged
Me.Controls.Add(fontListBox1)

Private Sub FontListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
    label1.Font = New System.Drawing.Font(
        fontListBox1.SelectedItem.ToString(), 11, System.Drawing.FontStyle.Regular)
End Sub

一般的なユースケース

シナリオ設定するプロパティ
テキストエディター用のフォント選択SelectionMode = One を設定し、SelectedIndexChanged を処理
複数のフォントを選択SelectionMode = MultiExtended
キーボードで素早く移動UseAutoComplete = true
スクロールバーを常に表示ScrollAlwaysVisible = true
アルファベット順に並べ替えたリストSorted = true
Office スタイルの外観VisualStyle = FontListBoxStyle.Office2016Colorful

コメント