๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
728x90
๋ฐ˜์‘ํ˜•

๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/C#23

C# - ์„ค์ • ๊ฐ’ ๋ฐฐ์—ด(array) ํ˜•ํƒœ๋กœ ์ €์žฅํ•˜๊ณ  ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ์ €์žฅํ•˜๊ธฐ string value = String.Join(",", intArray.Select(i => i.ToString()).ToArray()); Properties.Settings.Default.option_array = value; Properties.Settings.Default.Save(); ๋ถˆ๋Ÿฌ์˜ค๊ธฐ int[] arr = Properties.Settings.Default.option_array.Split(',').Select(s => Int32.Parse(s)).ToArray(); ์ถœ์ฒ˜: https://stackoverflow.com/questions/1766610/how-to-store-int-array-in-application-settings How to store int[] array .. 2023. 2. 1.
C# - dataGridView1 ์…€ ๊ฐ’ ์ˆ˜์ •ํ•˜๊ธฐ dataGridView1[1,1].Value="tes"; ์ถœ์ฒ˜: https://stackoverflow.com/questions/1516252/how-to-programmatically-set-cell-value-in-datagridview How to programmatically set cell value in DataGridView? I have a DataGridView. Some of the cells receive their data from a serial port: I want to shove the data into the cell, and have it update the underlying bound object. I'm trying something like th... stackov.. 2023. 2. 1.
C# - ๋งˆ์ดํฌ๋กœ์†Œํ”„ํŠธ ๊ณต์‹ UWP, WPF ์ž์Šต์„œ (GUI ํ”„๋กœ๊ทธ๋ž˜๋ฐ) ๋ฐ ๋‘˜์˜ ์ฐจ์ด์  UWP ์ž์Šต์„œ https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-uwp?view=vs-2022 ์ž์Šต์„œ: Visual Studio ๋ฐ C#์„ ์‚ฌ์šฉํ•˜์—ฌ UWP ์•ฑ ๋งŒ๋“ค๊ธฐ Visual Studio์—์„œ XAML ๋ฐ C#์„ ์‚ฌ์šฉํ•˜์—ฌ UWP ์•ฑ ๋งŒ๋“ค๊ธฐ learn.microsoft.com WPF ์ž์Šต์„œ https://learn.microsoft.com/ko-kr/visualstudio/get-started/csharp/tutorial-wpf?view=vs-2022 C#์—์„œ WPF๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Hello World ์•ฑ - Visual Studio (Windows) WPF(Windows Presentation Foundation) UI ํ”„.. 2023. 1. 19.
C# - textBox PlaceHolder ๊ตฌํ˜„ https://www.youtube.com/watch?v=VFeYyC_4It0 private void textBox_naverid_Enter(object sender, EventArgs e) { if( textBox_naverid.Text == "์•„์ด๋””") { textBox_naverid.Text = ""; textBox_naverid.ForeColor = Color.Black; } } private void textBox_naverpw_Enter(object sender, EventArgs e) { if (textBox_naverpw.Text == "๋น„๋ฐ€๋ฒˆํ˜ธ") { textBox_naverpw.Text = ""; textBox_naverpw.PasswordChar = 'โ—'; textBox_naverp.. 2022. 10. 26.
C# - ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ์—์„œ ํด๋ฆฝ๋ณด๋“œ ๊ธฐ๋Šฅ(OLE) ์‚ฌ์šฉํ•˜๊ธฐ // ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ํ•จ์ˆ˜ ์„ ์–ธ mainThread = new Thread(work); mainThread.SetApartmentState(ApartmentState.STA); mainThread.Start(); // ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ํ•จ์ˆ˜ ๋‚ด๋ถ€ Clipboard.SetText("ํ…Œ์ŠคํŠธ"); ์ถœ์ฒ˜: https://taeminimini.tistory.com/m/437 Thread ๋‚ด ์—์„œ OLE ํ˜ธ์ถœ์‹œ STAThreadAttribute C# Thread ํ•˜๋‹ค๋ณด๋‹ˆ ๋งŒ๋“ค์–ด๋†“์€ ์“ฐ๋ ˆ๋“œ์— Clipboard๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•˜๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์ด ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ๐Ÿ˜ฅ System.Threading.ThreadStateException: 'OLE ํ˜ธ์ถœ์„ ์ˆ˜ํ–‰ํ•˜๋ ค๋ฉด ํ˜„์žฌ ์Šค๋ ˆ๋“œ๋ฅผ STA(๋‹จ์ผ ์Šค๋ ˆ๋“œ ์•„ํŒŒํŠธ) taeminimini.tisto.. 2022. 10. 19.
C# - ๋ชจ๋˜ UI ํ”„๋ ˆ์ž„์›Œํฌ(MahApps.Metro) https://mahapps.com/ MahApps.Metro - Home Enhance the default controls MahApps.Metro overrides the default style of all common WPF controls and gives them a modern look. More than just styles MahApps.Metro also includes some custom controls based on concepts from Windows Phone, Windows 8 and Windo mahapps.com https://luckygg.tistory.com/302 [.Net] C# WinForm์—์„œ Metro UI(Modern UI) Framework ์ ์šฉํ•˜๊ธฐ(.. 2022. 10. 13.
C# - ๋น„์ฃผ์–ผ ์ŠคํŠœ๋””์˜ค, ์ฝ”๋“œ๊ฐ€ ์ ์šฉ์ด ์•ˆ๋˜๊ณ  ์ด์ „ ๊ฒƒ์œผ๋กœ ์‹คํ–‰ ๋˜๋Š” ๊ฒฝ์šฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• ๋นŒ๋“œ(B) > ์†”๋ฃจ์…˜ ์ •๋ฆฌ(C) 2022. 10. 11.
C# - ๋“œ๋ž˜๊ทธ ์•ค ๋“œ๋กญ(Drag & Drop) public partial class Form1 : Form { public Form1() { InitializeComponent(); this.AllowDrop = true; this.DragEnter += new DragEventHandler(Form1_DragEnter); this.DragDrop += new DragEventHandler(Form1_DragDrop); } void Form1_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; } void Form1_DragDrop(object sender, DragEventAr.. 2022. 10. 9.
C# - DateTime D-Day ๊ตฌํ•˜๊ธฐ(TimeSpan) D-Day ๊ตฌํ•˜๊ธฐ System.DateTime Time = new System.DateTime(2022, 12, 05); TimeSpan resultTime = Time - DateTime.Now; Console.writeLine("D-Days: " + resultTime.Days); ํŒŒ์ผ ๋งˆ์ง€๋ง‰ ์ˆ˜์ •์ผ ๊ฒฝ๊ณผ ์ผ ๊ตฌํ•˜๊ธฐ DateTime LastWriten = File.GetLastWriteTime("memo.txt"); TimeSpan resultTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day) - new DateTime(LastWriten.Year, LastWriten.Month, LastWriten.Day); if.. 2022. 10. 8.
C# - CookieContainer ์ฟ ํ‚ค ๊ฐ’ ๊ฐ€์ ธ์˜ค๊ธฐ CookieContainer cookies = new CookieContainer(); cookies.Add(new Cookie("name1", "value1", "/", "www.domain1.com")); cookies.Add(new Cookie("name2", "value2", "/", "www.domain2.com")); Hashtable table = (Hashtable)cookies.GetType().InvokeMember("m_domainTable", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance, null, cookies, new object[] { }); foreach (var key in table.Keys.. 2022. 10. 3.
C# - RichTextBox ์ƒ‰๊น” ์ง€์ • void AppendRichText(RichTextBox box, string text, Color color) { box.SelectionStart = box.TextLength; box.SelectionLength = 0; box.SelectionColor = color; box.AppendText(text + "\n"); box.SelectionColor = box.ForeColor; } ์ถœ์ฒ˜: https://stackoverflow.com/questions/1926264/color-different-parts-of-a-richtextbox-string Color different parts of a RichTextBox string I'm trying to color parts of a strin.. 2022. 9. 29.
C# - ์„ค์ • ๊ฐ’ ์ €์žฅํ•˜๊ณ  ๋ถˆ๋Ÿฌ์˜ค๊ธฐ ํ”„๋กœ์ ํŠธ -> ํ”„๋กœ์ ํŠธ.์†์„ฑ -> ์„ค์ •์—์„œ ์‚ฌ์ง„ ์ฒ˜๋Ÿผ ์ €์žฅ ํ•˜๊ณ ์ž ํ•˜๋Š” ๋ณ€์ˆ˜๋ฅผ ๋งŒ๋“ ๋‹ค. private void Form1_Load(object sender, EventArgs e) { tbIpAdress.Text = Properties.Settings.Default.tbIpAdress_Value; tbCarWashSerial.Text = Properties.Settings.Default.tbCarWashSerial_Value; } ์œ„์— ์ฝ”๋“œ์ฒ˜๋Ÿผ ์ฝ์–ด ์˜ค๊ธฐ๋งŒ ํ•˜๋ฉด ๋œ๋‹ค. private void btnSave_Click(object sender, EventArgs e) { Properties.Settings.Default.tbIpAdress_Value = tbIpAdress.Text; Properties.S.. 2022. 9. 26.
728x90
๋ฐ˜์‘ํ˜•