예제 #1
0
        void openVLCModeDialog(string machineName)
        {
            VLCModeDialog objVLCModeDialog = new VLCModeDialog();

            objVLCModeDialog.vlcName = machineName;
            int vlcMode = objVLCDba.getVLCMode(machineName);

            objVLCModeDialog.updateModeEvent += new EventHandler(radioChecked_VLCModeDialog);
            objVLCModeDialog.initializeRadio(vlcMode);
            //objVLCModeDialog.po
            objVLCModeDialog.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            objVLCModeDialog.ShowDialog();
        }
예제 #2
0
        private void VLC1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            VLCModeControl cntrl = (VLCModeControl)sender;

            //  openVLCModeDialog(cntrl.Name);
            string machineName = cntrl.Name;

            VLCModeDialog objVLCModeDialog = new VLCModeDialog();

            objVLCModeDialog.vlcName = machineName;
            int vlcMode = objVLCDba.getVLCMode(machineName);

            objVLCModeDialog.updateModeEvent += new EventHandler(radioChecked_VLCModeDialog);
            objVLCModeDialog.initializeRadio(vlcMode);
            objVLCModeDialog.StartPosition = System.Windows.Forms.FormStartPosition.Manual;

            Int32 relx = Math.Abs(Convert.ToInt32(cntrl.PointFromScreen(new System.Windows.Point(0, 0)).X));
            Int32 relY = Math.Abs(Convert.ToInt32(cntrl.PointFromScreen(new System.Windows.Point(0, 0)).Y));

            objVLCModeDialog.Left = relx - (objVLCModeDialog.Width / 2);
            objVLCModeDialog.Top  = relY + Convert.ToInt32(cntrl.Height);
            objVLCModeDialog.ShowDialog();
        }