목록전체 글 (292)
분노의 챔질
Button b = new Button();b.Name = "btnTest";b.TextAlign = ContentAlignment.MiddleLeft;b.Font = new Font("맑은 고딕", 11, FontStyle.Bold);b.Text = "버튼";b.Size = new Size(250, 50);b.Location = new Point(10, 10);b.BringToFront();b.MouseClick += btn_MouseClick;panel3.Controls.Add(b); 버튼으로
private void button5_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { Button bt = sender as Button; int x = 0, y = 0; if (bt.Location.X + e.X this.Width) x = this.Width - bt.Width; else x = bt.Location.X + e.X; if (bt.Loca..
RegistryKey reg; //HKEY_CURRENT_USER //쓰기 reg = Registry.CurrentUser.CreateSubKey("SOFTWARE").CreateSubKey("Test"); reg.SetValue("TestValue", "A", RegistryValueKind.String); //읽기 reg = Registry.CurrentUser.CreateSubKey("SOFTWARE").CreateSubKey("RTLS"); string val = reg.GetValue("TestValue", "NONE").ToString(..
Screen[] sc = Screen.AllScreens;foreach (var item in sc){ if(item.WorkingArea.Contains(this.Location)) this.Location = new Point(item.Bounds.Width + 10, 0);}form.show();form.WindowState = FormWindowState.Maximized;해봐
[DllImport("kernel32")]public static extern int WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName);[DllImport("kernel32")]public static extern uint GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName);[DllImport("kernel32")]public static extern int GetPrivateProfileString(string lpAppName, string lpKeyName, strin..
public void WriteLog(string logMessage){ logMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " : " + logMessage; string logpath = Application.StartupPath + @"\Logs"; try { DirectoryInfo di = new DirectoryInfo(logpath); if (di.Exists == false) { di.Create(); } File.AppendAllText(logpath + @"\" + DateTime.Now.ToString("yyyy-MM-dd") ..
private delegate void UpdateText(Control ctrl, string text);public void AsyncDisplayText(Control ctrl, string text){ if (ctrl.InvokeRequired) { ctrl.Invoke(new UpdateText(AsyncDisplayText), new object[] { ctrl, text }); } else { if (ctrl.AccessibilityObject.Role == AccessibleRole.List) { ListBox li = ctrl as ListBox; li.Items.Insert(0, Da..
MyEvents.csusing System;using System.Collections.Generic;using System.Linq;using System.Text;namespace EventsTest{ public class MyEvents { string returnstring = string.Empty; public MyEvents() { } public void CallEvents(string val) { if(val == "철수") { MyEventsEventArgs rev = new MyEventsEventArgs("남자", val); ..