예제 #1
0
        /// <summary>
        /// Displays the screenshot and filename when the form loads.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UploadDialog_Load(object sender, EventArgs e)
        {
            if (_screenshot != null)
            {
                ScreenshotPreview.Image = _screenshot.Bitmap;

                string defaultFileName = _screenshot.GetFileName();
                FileNameInput.Text = defaultFileName;

                // Select only the filename itself
                string fileName = System.IO.Path.GetFileNameWithoutExtension(defaultFileName);
                int    iStart   = defaultFileName.IndexOf(fileName);
                if (iStart < 0)
                {
                    iStart = 0;
                }

                FileNameInput.Select(iStart, fileName.Length);
                FileNameInput.Focus();
            }
        }
        public ScreenNamePrompt()
        {
            InitializeComponent();

            FileNameInput.Focus();
        }