更新 : 2007 年 11 月 このサンプルでは、ユーザーによって RichTextBox に貼り付けられたテキストからハイパーリンク文字列を検出するカスタム RichTextBox 実装を作成する方法を示します。 このサンプルは、決まった文字列 (www.microsoft.com) のみハイパーリンクとして検出します。実際のアプリケーションでは、ハイパーリンクの検出に正規表現一致などを使用します。 Windows Presentation Foundation (WPF) と Microsoft .NET Framework のアプリケーション開発ベスト プラクティスの包括的な説明については、適宜、次のトピックを参照してください。 ユーザー補助 - 「ユーザー補助のベスト プラクティス」 セキュリティ - 「Windows Presentation Foundation のセキュリテ
This topic provides an overview of a Silverlight Text Editor sample. Using this sample, you can type and edit rich text, and perform several operations. The operations include formatting text, inserting images, inserting calendars, inserting data grids, displaying text right-to-left, printing, and accessing the clipboard. This sample is based on the RichTextBox control in Silverlight 4 or later. T
[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。] 次のサンプルでは、RichTextBox コントロールの各種機能を示します。 このセクションの内容 RichTextBox に入力されたハイパーリンクの自動検出 RichTextBox に貼り付けられたハイパーリンクの自動検出 ツール バーのある RichTextBox の作成のサンプル プレーンテキスト入力のための RichTextBox のカスタマイズ RichTextBox でのカスタム コンテキスト メニューの配置のサンプル RichTextBox の既定のコンテンツ ホストの置き換えのサンプル 参照 参照 TextBox 概念 Documents in Windows Presentation Foundation Flow Docume
WPFのTextBoxはIMEの変換中でも、TextBox.TextChangedイベントが発生します。 これはこれで便利なのですが、TextBoxへ入力可能な文字種別を制限したい場合などには苦労します。 TextChangedイベント内では、文字列が確定されているかどうかを判断する適切な方法が見つかりませんでした。 とりあえず、ネットで検索していると、TextCompositionManagerを使うとうまくいくかも的な書き込みを発見したのでいろいろと調査してみました。 対象のイベントは4つ。TextBoxの場合、TextInputイベントは発生することはないらしいので(※)、すべてPreview系で統一です。 (※)http://msdn.microsoft.com/ja-jp/library/system.windows.uielement.textinput(v=VS.90).as
コントロールのショートカットキーを編集・処理する 概要 コントロールのショートカットキーを編集・処理する方法を紹介します。 ショートカットキーを処理するとテキストボックスのように Ctrl + A で全選択するような処理ができます。 対象コントロール System.Windows.Forms.Control から派生しているクラス 解説 ここでいうショートカットキーとは、Ctrl + A でフォーカスのあるコントロールを全選択するなど、入力したコントロール内で解決できるキーのことを言います。Ctrl + S で保存処理を行うようなフォーム全体で処理するショートカットキーについては「ボタンにショートカットキーを割り当てる」を参照してください。 キーを処理するには ProcessCmdKey メソッドをオーバーライドする方法と KeyDown イベントを利用する方法があります。 Process
public ref class EditingCommands abstract sealed public static class EditingCommands type EditingCommands = class Public Class EditingCommands 継承 例 次の例では、コマンドをサポートするオブジェクトに対して編集コマンドを呼び出す方法を示します。 この例では、 RichTextBox コマンド ターゲットとして機能します。 RichTextBoxインターフェイス (継承されたFrameworkElementインターフェイス) をIInputElement実装し、多くの編集コマンドのネイティブ サポートが含まれている点に注意してください。 メソッドの最初の Execute 引数はコマンド パラメーターです。 ほとんどの編集コマンドでは、コマンド パラメ
上の表の機能については、後で詳しく説明します。 RichTextBox の作成 以下のコードには、ユーザーがリッチ コンテンツを編集できる RichTextBox を作成する方法が示されています。 <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <!-- A RichTextBox with no initial content in it. --> <RichTextBox /> </Page> 具体的には、RichTextBox で編集されるコンテンツはフロー コンテンツです。 フロー コンテンツは、書式設定されたテキスト、イメージ、リスト、テーブルなどのさまざまな種類の要素を格納
RichTextBox is a control that enables you to display or edit rich content including paragraphs, hyperlinks, and inline images. This topic introduces the RichTextBox control, describes some of its features, and shows examples of how to use it in XAML and code. This topic contains the following sections. TextBlock, TextBox, or RichTextBox Content Model Creating a RichTextBox Hyperlinks Inline Images
This example shows how to use the ITextDocument.SetText method to programmatically add text to a RichEditBox. <RichEditBox x:Name="richEditBox" Width="500" Header="Notes"/> richEditBox.Document.SetText(Windows.UI.Text.TextSetOptions.None, "This is some sample text"); This example shows how to edit, load, and save a Rich Text Format (.rtf) file in a RichEditBox. <RelativePanel Margin="20" Horizonta
public: System::Windows::Documents::TextPointer ^ GetNextContextPosition(System::Windows::Documents::LogicalDirection direction); public System.Windows.Documents.TextPointer GetNextContextPosition (System.Windows.Documents.LogicalDirection direction); member this.GetNextContextPosition : System.Windows.Documents.LogicalDirection -> System.Windows.Documents.TextPointer Public Function GetNextContex
次の例では、TextPointer オブジェクトを 2 つ使用し、Span 要素の適用対象とする範囲をテキスト内で指定する方法を示します。 例 using System; using System.Windows; using System.Windows.Media; using System.Windows.Controls; using System.Windows.Documents; namespace SDKSample { public partial class InsertInlineIntoTextExample : Page { public InsertInlineIntoTextExample() { // Create a paragraph with a short sentence Paragraph myParagraph = new Paragraph(
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く