Dreamine.UI.WinForms 1.0.1
Dreamine.UI.WinForms 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.UI.WinForms.Controls.DreaminePasswordBox 클래스 참조

더 자세히 ...

Dreamine.UI.WinForms.Controls.DreaminePasswordBox에 대한 상속 다이어그램 :
Dreamine.UI.WinForms.Controls.DreaminePasswordBox에 대한 협력 다이어그램:

Public 멤버 함수

 DreaminePasswordBox ()

Protected 멤버 함수

override void OnLayout (LayoutEventArgs e)
override void OnPaint (PaintEventArgs e)

속성

string Password [get, set]
string Hint [get, set]
override Color ForeColor [get, set]
new Font Font [get, set]
override Size DefaultSize [get]

이벤트

EventHandler? PasswordChanged

Private 멤버 함수

static IntPtr SendMessage (IntPtr hWnd, int msg, IntPtr wParam, string lParam)

Private 속성

readonly TextBox _inner
bool _isFocused
string _hint = string.Empty

정적 Private 속성

const int EM_SETCUEBANNER = 0x1501

상세한 설명

암호 마스킹, 힌트 텍스트 및 포커스 테두리를 제공하는 WinForms 암호 입력 래퍼입니다.

DreaminePasswordBox.cs 파일의 15 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ DreaminePasswordBox()

Dreamine.UI.WinForms.Controls.DreaminePasswordBox.DreaminePasswordBox ( )
inline

내부 암호 상자, 힌트 처리 및 Dreamine 테마 기본값을 구성합니다.

DreaminePasswordBox.cs 파일의 186 번째 라인에서 정의되었습니다.

187 {
188 // _inner must be created first — SetStyle and property setters below
189 // can trigger OnLayout / ForeColor / Font overrides before the field is set.
190 _inner = new TextBox
191 {
192 BorderStyle = BorderStyle.None,
193 BackColor = DreamineTheme.InputBackground,
194 ForeColor = DreamineTheme.TextPrimary,
195 Font = new Font("Segoe UI", 10f, FontStyle.Regular, GraphicsUnit.Point),
196 UseSystemPasswordChar = true,
197 };
198
199 _inner.GotFocus += (_, _) => { _isFocused = true; Invalidate(); };
200 _inner.LostFocus += (_, _) => { _isFocused = false; Invalidate(); };
201 _inner.TextChanged += (s, e) => PasswordChanged?.Invoke(this, e);
202 _inner.HandleCreated += (_, _) =>
203 {
204 if (!string.IsNullOrEmpty(_hint))
205 SendMessage(_inner.Handle, EM_SETCUEBANNER, (IntPtr)1, _hint);
206 };
207
208 SetStyle(
209 ControlStyles.AllPaintingInWmPaint |
210 ControlStyles.UserPaint |
211 ControlStyles.DoubleBuffer |
212 ControlStyles.ResizeRedraw, true);
213
214 BackColor = DreamineTheme.InputBackground;
215 ForeColor = DreamineTheme.TextPrimary;
216 Font = _inner.Font;
217 Height = 36;
218
219 Controls.Add(_inner);
220 }

다음을 참조함 : _hint, _inner, _isFocused, EM_SETCUEBANNER, Font, ForeColor, Dreamine.UI.WinForms.DreamineTheme.InputBackground, PasswordChanged, SendMessage(), Dreamine.UI.WinForms.DreamineTheme.TextPrimary.

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 함수 문서화

◆ OnLayout()

override void Dreamine.UI.WinForms.Controls.DreaminePasswordBox.OnLayout ( LayoutEventArgs e)
inlineprotected

내부 암호 상자를 래퍼의 현재 크기에 맞춰 배치합니다.

매개변수
e레이아웃 이벤트 인수입니다.

DreaminePasswordBox.cs 파일의 238 번째 라인에서 정의되었습니다.

239 {
240 base.OnLayout(e);
241 if (_inner == null) return;
242 _inner.SetBounds(6, (Height - _inner.PreferredHeight) / 2,
243 Width - 12, _inner.PreferredHeight);
244 }

다음을 참조함 : _inner.

◆ OnPaint()

override void Dreamine.UI.WinForms.Controls.DreaminePasswordBox.OnPaint ( PaintEventArgs e)
inlineprotected

현재 포커스 상태에 맞게 둥근 배경과 테두리를 그립니다.

매개변수
e컨트롤 그리기 이벤트 인수입니다.

DreaminePasswordBox.cs 파일의 262 번째 라인에서 정의되었습니다.

263 {
264 var g = e.Graphics;
265 var rect = new Rectangle(0, 0, Width - 1, Height - 1);
266 using var bgBrush = new SolidBrush(BackColor);
267 var borderColor = _isFocused ? DreamineTheme.BorderFocus : DreamineTheme.BorderNormal;
268 using var pen = new Pen(borderColor, 1.5f);
269 DreamineDrawHelper.FillRoundedRect(g, bgBrush, pen, rect, DreamineTheme.CornerRadiusSmall);
270 }

다음을 참조함 : _isFocused, Dreamine.UI.WinForms.DreamineTheme.BorderFocus, Dreamine.UI.WinForms.DreamineTheme.BorderNormal, Dreamine.UI.WinForms.DreamineTheme.CornerRadiusSmall, Dreamine.UI.WinForms.DreamineDrawHelper.FillRoundedRect().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ SendMessage()

IntPtr Dreamine.UI.WinForms.Controls.DreaminePasswordBox.SendMessage ( IntPtr hWnd,
int msg,
IntPtr wParam,
string lParam )
private

Win32 메시지를 내부 텍스트 상자에 보내 힌트 배너를 설정합니다.

매개변수
hWnd대상 창 핸들입니다.
msg전송할 Win32 메시지 식별자입니다.
wParam메시지의 정수 포인터 매개변수입니다.
lParam메시지에 전달할 문자열입니다.
반환값
메시지 처리 결과입니다.

다음에 의해서 참조됨 : DreaminePasswordBox().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _hint

string Dreamine.UI.WinForms.Controls.DreaminePasswordBox._hint = string.Empty
private

hint 값을 보관합니다.

DreaminePasswordBox.cs 파일의 119 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DreaminePasswordBox().

◆ _inner

readonly TextBox Dreamine.UI.WinForms.Controls.DreaminePasswordBox._inner
private

inner 값을 보관합니다.

DreaminePasswordBox.cs 파일의 85 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DreaminePasswordBox(), OnLayout().

◆ _isFocused

bool Dreamine.UI.WinForms.Controls.DreaminePasswordBox._isFocused
private

is Focused 값을 보관합니다.

DreaminePasswordBox.cs 파일의 94 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DreaminePasswordBox(), OnPaint().

◆ EM_SETCUEBANNER

const int Dreamine.UI.WinForms.Controls.DreaminePasswordBox.EM_SETCUEBANNER = 0x1501
staticprivate

EM SETCUEBANNER 값을 보관합니다.

DreaminePasswordBox.cs 파일의 25 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DreaminePasswordBox().

속성 문서화

◆ DefaultSize

override Size Dreamine.UI.WinForms.Controls.DreaminePasswordBox.DefaultSize
getprotected

암호 입력 래퍼의 기본 크기를 가져옵니다.

DreaminePasswordBox.cs 파일의 280 번째 라인에서 정의되었습니다.

◆ Font

new Font Dreamine.UI.WinForms.Controls.DreaminePasswordBox.Font
getset

래퍼와 내부 텍스트 상자의 글꼴을 가져오거나 설정합니다.

DreaminePasswordBox.cs 파일의 161 번째 라인에서 정의되었습니다.

162 {
163 get => base.Font;
164 set { base.Font = value; if (_inner != null) _inner.Font = value; }
165 }

다음에 의해서 참조됨 : DreaminePasswordBox().

◆ ForeColor

override Color Dreamine.UI.WinForms.Controls.DreaminePasswordBox.ForeColor
getset

래퍼와 내부 텍스트 상자의 전경색을 가져오거나 설정합니다.

DreaminePasswordBox.cs 파일의 147 번째 라인에서 정의되었습니다.

148 {
149 get => base.ForeColor;
150 set { base.ForeColor = value; if (_inner != null) _inner.ForeColor = value; }
151 }

다음에 의해서 참조됨 : DreaminePasswordBox().

◆ Hint

string Dreamine.UI.WinForms.Controls.DreaminePasswordBox.Hint
getset

입력 전 표시할 네이티브 힌트 배너를 가져오거나 설정합니다.

DreaminePasswordBox.cs 파일의 128 번째 라인에서 정의되었습니다.

129 {
130 get => _hint;
131 set
132 {
133 _hint = value;
134 if (_inner.IsHandleCreated)
135 SendMessage(_inner.Handle, EM_SETCUEBANNER, (IntPtr)1, _hint);
136 }
137 }

◆ Password

string Dreamine.UI.WinForms.Controls.DreaminePasswordBox.Password
getset

마스킹된 암호 텍스트를 가져오거나 설정합니다.

DreaminePasswordBox.cs 파일의 105 번째 라인에서 정의되었습니다.

106 {
107 get => _inner.Text;
108 set => _inner.Text = value;
109 }

이벤트 문서화

◆ PasswordChanged

EventHandler? Dreamine.UI.WinForms.Controls.DreaminePasswordBox.PasswordChanged

내부 암호 텍스트가 변경될 때 발생합니다.

DreaminePasswordBox.cs 파일의 175 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : DreaminePasswordBox().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: