TextBoxBase.GetFirstCharIndexFromLine メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TextBoxBase.GetFirstCharIndexFromLine メソッドの意味・解説 

TextBoxBase.GetFirstCharIndexFromLine メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

指定した行の最初の文字のインデックスを取得します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Function GetFirstCharIndexFromLine (
 _
    lineNumber As Integer _
) As Integer
Dim instance As TextBoxBase
Dim lineNumber As Integer
Dim returnValue As Integer

returnValue = instance.GetFirstCharIndexFromLine(lineNumber)
public int GetFirstCharIndexFromLine (
    int lineNumber
)
public:
int GetFirstCharIndexFromLine (
    int lineNumber
)
public int GetFirstCharIndexFromLine (
    int lineNumber
)
public function GetFirstCharIndexFromLine (
    lineNumber : int
) : int

パラメータ

lineNumber

最初の文字のインデックスを取得する行。

戻り値
指定した行における 0 から始まる文字のインデックス。

例外例外
例外の種類条件

ArgumentOutOfRangeException

lineNum パラメータの値が 0 未満です。

解説解説

lineNum パラメータが負の場合、GetFirstCharIndexFromLine は 0 を返します。また、lineNum パラメータがコントロールの行数を超えている場合、GetFirstCharIndexFromLine は -1 を返します。

GetFirstCharIndexFromLine は、物理行の最初の文字のインデックスを返します。物理行は、割り当てられた行ではなく、表示されている行です。ワード ラップが原因で、表示されている行の数が割り当てられた行の数を上回る場合があります。たとえば、2 つの長い行を RichTextBox コントロールに割り当て、Multiline と WordWrap を true に設定すると、割り当てられた 2 つの長い行が 4 つの物理行 (表示されている行) になります。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TextBoxBase クラス
TextBoxBase メンバ
System.Windows.Forms 名前空間
GetCharIndexFromPosition
GetLineFromCharIndex
GetPositionFromCharIndex
GetCharFromPosition



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

TextBoxBase.GetFirstCharIndexFromLine メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TextBoxBase.GetFirstCharIndexFromLine メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS