示例#1
0
        //evento dragOver
        private void JFileChooser_DragOver(object sender, DragEventArgs e)
        {
            JFileChooser tmp_sender = (JFileChooser)sender;
            string       tmp_data   = e.Data.GetData(DataFormats.Text).ToString();

            if (!tmp_data.ToLower().Equals(tmp_sender.Name.ToLower()))
            {
                return;
            }
            Point tmp_point = tmp_sender.Parent.PointToClient(new System.Drawing.Point(e.X, e.Y));
            int   x         = tmp_point.X - (tmp_sender.Width / 2);
            int   y         = tmp_point.Y - (tmp_sender.Height / 2);

            tmp_sender.Location = new Point(x, y);
            mandarPropiedades();
        }
示例#2
0
        //evento mouseDown
        private void JFileChooser_MouseDown(object sender, MouseEventArgs e)
        {
            JFileChooser tmp = (JFileChooser)sender;

            tmp.DoDragDrop(tmp.Name, DragDropEffects.Copy);

            if (e.Clicks == 1)
            {
                mandarPropiedades();
            }
            else
            if (e.Clicks == 2)
            {
                string borrar_tmp = Inst_myform.preguntar("¿Borrar " + Name + "?");
                if (borrar_tmp.ToLower().Equals("si"))
                {
                    Inst_myform.Vg_ArrayJFileChooser.Remove(Name);
                    Inst_myform.Vg_ArrayJFileChooser.Add("0");
                    this.Dispose(true);
                }
            }
        }