Beispiel #1
0
 public Form1()
 {
     InitializeComponent();
     string value = "Document 1";
     
     if (Tmp.InputBox("New document", "New document name:", ref value, new Bitmap("Your Image Here") == DialogResult.OK)
     {
         this.Text = value;
     }
 }
Beispiel #2
0
        private void addURL_Click(object sender, EventArgs e)
        {
            string reg   = @"https:\/\/youtu.be\/([a-zA-Z0-9]){11}";
            string value = "https://youtu.be/";

            if (Tmp.InputBox("Tiny youtube url hozzáadása", "Adja meg a tiny youtube url-t:", ref value) == DialogResult.OK)
            {
                if (Regex.IsMatch(value, reg))
                {
                    connection.Open();
                    SqlDataReader command = new SqlCommand($"update Tracks set url = '{value.Remove(0, 17)}' where title like '{dgwTitles.SelectedRows[0].Cells[0].Value.ToString()}'", connection).ExecuteReader();
                    connection.Close();
                }
                else
                {
                    MessageBox.Show("Nem megfelelő link!");
                }
            }
        }
Beispiel #3
0
        private void _toolStripMenuItem_Click(object sender, EventArgs e)
        {
            /*foreach (ToolStripMenuItem item in toolStripMenuItem2.DropDownItems)
             * {
             *  item.Checked = false;
             * }
             * ((ToolStripMenuItem)sender).Checked = true;*/
            //string s = string.Format("{0}\n{1}", sender.ToString(), e.ToString());
            //MessageBox.Show(s);
            String txt   = event_Buttons[now_click_btn].Text;
            String value = "";

            if ((((ToolStripMenuItem)sender).Text.Split('_')[0]) == "Run")
            {
                event_Buttons[now_click_btn].Text = ((ToolStripMenuItem)sender).Text;
            }
            else if ((((ToolStripMenuItem)sender).Text.Split('_')[0]) == "Send")
            {
                event_Buttons[now_click_btn].Text = ((ToolStripMenuItem)sender).Text;
            }
            else if ((((ToolStripMenuItem)sender).Text).Equals("원하는 내용입력"))
            {
                if (Tmp.InputBox("입력", "입력하고 싶은 내용", ref value) == DialogResult.OK)
                {
                    if (value.Split('_')[0].Equals("Send") || value.Split('_')[0].Equals("Rund"))
                    {
                        MessageBox.Show("사용자 입력에서는 이벤트를 사용할 수 없습니다.");
                    }
                    else
                    {
                        if (value.Length > 100)
                        {
                            MessageBox.Show("사용자 입력내용이 너무 많습니다.");
                        }
                        else
                        {
                            event_Buttons[now_click_btn].Text = value;
                        }
                    }
                }
            }
        }