Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace clipKeep
- {
- public partial class expandForm : Form
- {
- public expandForm(string listItem)
- {
- InitializeComponent();
- //Read the text from the main form
- fullTextBox.Text = listItem;
- }
- //Default is false for obvious reasons
- bool sendData = false;
- private void saveButton_Click(object sender, EventArgs e)
- {
- //If saved then send the data
- sendData = true;
- this.Close();
- }
- public string textData()
- {
- //To send the data to the main form
- if (sendData)
- return fullTextBox.Text;
- else
- return "";
- }
- private void fullTextBox_KeyPress(object sender, KeyPressEventArgs e)
- {
- //Allows pressing ENTER for saving
- if (e.KeyChar == (char)Keys.Enter)
- saveButton_Click(null, null);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment