분류 전체보기34 C# Winform | String to Byte Array | Byte Array to String C# Winform | String to Byte Array | Byte Array to String String to Byte Array private byte[] StringToByte(string str) { byte[] bytes = Encoding.Default.GetBytes(str); return bytes; } Colored by Color Scripter cs Byte Array to String private string ByteToString(byte[] bytes) { string str = Encoding.Default.GetString(bytes); return str; } Colored by Color Scripter cs Test Code private void btnTest.. 2020. 12. 8. C# Winform | AsyncSocket | Client Socket C# Winform | AsyncSocket | Client Socket Socket Class 생성 using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; namespace AsyncSocket { public class StateObject { private const int BUFFER_SIZE = 327680; private Socket worker; private byte[] buffer; public StateObject(Socket worker) { this.worker = worker; this.buffer.. 2020. 12. 8. C# Winform | textbox vertical alignment | custom control C# Winform | textbox vertical alignment | custom control 1. TextBox 상속 클래스 만들기 프로젝트 -> 새 항목 추가 -> 클래스 클래스 이름 : VerticalTextBox.cs 2. TextBox 상속 클래스 Code 작성 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; public class VerticalTextBox : Control { public.. 2020. 12. 4. List Of Windows Messages | WndProc List Of Windows Messages | WndProc List Hex 값 Intager 값 Symbol 이름 0000 0 WM_NULL 0001 1 WM_CREATE 0002 2 WM_DESTROY 0003 3 WM_MOVE 0005 5 WM_SIZE 0006 6 WM_ACTIVATE 0007 7 WM_SETFOCUS 0008 8 WM_KILLFOCUS 000a 10 WM_ENABLE 000b 11 WM_SETREDRAW 000c 12 WM_SETTEXT 000d 13 WM_GETTEXT 000e 14 WM_GETTEXTLENGTH 000f 15 WM_PAINT 0010 16 WM_CLOSE 0011 17 WM_QUERYENDSESSION 0012 18 WM_QUIT 0013 19 WM_QUER.. 2020. 11. 30. C# Winform | Watermark in a textbox | Placeholder | custom control C# Winform | Watermark in a textbox | Placeholder | custom control 1. TextBox 상속 클래스 만들기 프로젝트 -> 새 항목 추가 -> 클래스 클래스 이름 : wmTextBox.cs 2. TextBox 상속 클래스 Code 작성 using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; public class wmTextBox : TextBox { public w.. 2020. 11. 25. C# Winform | remove zero from decimal c# C# Winform | remove zero from decimal c# Test Code decimal zero_decimal = 123.1231230000000m; Console.WriteLine(zero_decimal); //Remove Zero Decimal string strdec = zero_decimal.ToString(System.Globalization.CultureInfo.InvariantCulture); string ret = strdec.Contains(".") ? strdec.TrimEnd('0').TrimEnd('.') : strdec; Console.WriteLine(ret); decimal retdec = decimal.Parse(ret); Console.WriteLine(r.. 2020. 11. 16. 이전 1 2 3 4 5 6 다음