コード例 #1
0
        private Label CreateColorLabel(PostItData data)
        {
            Label label = new Label();

            label.AutoSize  = true;
            label.Location  = new Point(603, 31);
            label.Name      = "colorLabel";
            label.Size      = new Size(48, 20);
            label.TabIndex  = 3;
            colorLabel.Font = new Font("Comic Sans MS", 12F, FontStyle.Regular, GraphicsUnit.Point, 0);
            label.Text      = "color:";
            return(label);
        }
コード例 #2
0
        private Button CreateChangeColorButton(PostItData data)
        {
            Button button = new Button();

            button.FlatAppearance.BorderSize = 3;
            button.FlatStyle = FlatStyle.Flat;
            button.ForeColor = SystemColors.ActiveCaptionText;
            button.Location  = new Point(659, 25);
            button.Name      = $"colorButton_{data.index}";
            button.Size      = new Size(32, 32);
            button.TabIndex  = 2;
            clickToType.SetToolTip(button, "Click To Change Color\r\n");
            button.UseVisualStyleBackColor = true;
            button.Click += Color_Click;
            return(button);
        }
コード例 #3
0
        private TextBox CreateTitle(PostItData data)
        {
            var newTitle = new TextBox();

            newTitle.Location     = new Point(16, 17);
            newTitle.BackColor    = data.color;
            newTitle.Text         = data.title;
            newTitle.BorderStyle  = BorderStyle.None;
            newTitle.Font         = new Font("Comic Sans MS", 36F, FontStyle.Bold, GraphicsUnit.Point, 0);
            newTitle.Location     = new Point(16, 17);
            newTitle.Size         = new Size(394, 60);
            newTitle.TabIndex     = 0;
            newTitle.Name         = $"title_{data.index}";
            newTitle.TextChanged += noteContent_TextChanged;
            clickToType.SetToolTip(newTitle, "Click To Start Typing");
            return(newTitle);
        }
コード例 #4
0
        private Button CreateAddNoteButton(PostItData data)
        {
            var button = new Button();

            button.BackColor = Color.FromArgb(128, 255, 128);
            button.FlatAppearance.BorderSize = 0;
            button.FlatStyle = FlatStyle.Flat;
            button.Font      = new Font("Comic Sans MS", 27.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            button.Location  = new Point(706, 17);
            button.Size      = new Size(53, 49);
            button.TabIndex  = 4;
            button.Text      = "+";
            clickToType.SetToolTip(button, "Click To Add A New Note");
            button.UseVisualStyleBackColor = false;
            button.Click += Create_Click;
            button.Name   = $"addNote_{data.index}";
            return(button);
        }
コード例 #5
0
        private Button CreateRemoveNoteButton(PostItData data)
        {
            Button button = new Button();

            button.BackColor = Color.Red;
            button.FlatAppearance.BorderSize = 0;
            button.FlatStyle = FlatStyle.Flat;
            button.Font      = new Font("Comic Sans MS", 27.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            button.ForeColor = SystemColors.Control;
            button.Location  = new Point(775, 17);
            button.Size      = new Size(53, 49);
            button.TabIndex  = 5;
            button.Text      = "-";
            clickToType.SetToolTip(button, "Click To Add A New Note");
            button.UseVisualStyleBackColor = false;
            button.Click += Remove_Click;
            button.Name   = $"removeNote_{data.index}";
            return(button);
        }
コード例 #6
0
        public void ParseData(string path)
        {
            string[]   text = File.ReadAllLines(path);
            PostItData data = new PostItData();

            data.title = text[0];
            data.color = Color.FromArgb(Convert.ToInt32(text[1].Split(',').First()), Convert.ToInt32(text[1].Split(',')[1]), Convert.ToInt32(text[1].Split(',').Last()));
            List <string> notedata = new List <string>();
            int           count    = 0;

            foreach (var line in text)
            {
                if (count > 1)
                {
                    notedata.Add(line);
                }
                count++;
            }
            data.note  = notedata.ToArray();
            data.index = Convert.ToInt32(path.Split('\\').Last().Split('.').First());
            postIts.Add(data);
        }
コード例 #7
0
        private TextBox CreateNoteContent(PostItData data)
        {
            var newBox = new TextBox();

            newBox.AcceptsReturn = true;
            newBox.AcceptsTab    = true;
            newBox.BackColor     = data.color;
            newBox.BorderStyle   = BorderStyle.None;
            newBox.Font          = new Font("Comic Sans MS", 21.75F, FontStyle.Regular, GraphicsUnit.Point, 0);
            newBox.Location      = new Point(15, 102);
            newBox.Multiline     = true;
            newBox.Size          = new Size(809, 581);
            newBox.TabIndex      = 1;
            newBox.TabStop       = false;
            newBox.Name          = $"noteContent_{data.index}";
            foreach (var item in data.note)
            {
                newBox.AppendText(item + Environment.NewLine);
            }
            clickToType.SetToolTip(newBox, "Click To Start Typing");
            newBox.TextChanged += noteContent_TextChanged;
            return(newBox);
        }