Show() 공개 메소드

public Show ( string text, IWin32Window window ) : void
text string
window IWin32Window
리턴 void
예제 #1
1
 private void textBoxEnd_MouseHover(object sender, EventArgs e)
 {
     myToolTip.Show("Enter a period value to end at.", textBoxEnd, 3000);
 }
예제 #2
0
 public void ShowBalloon(string Msg)
 {
     myToolTip.IsBalloon = true;
     myToolTip.Show(string.Empty, this, 0);
     myToolTip.Show(Msg, this, this.Width / 2, this.Height, 3000);
     this.Focus();
 }
예제 #3
0
 //this.xTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
 #region Methods
 public void ShowBalloon(string Msg)
 {
     System.Windows.Forms.ToolTip myToolTip = new System.Windows.Forms.ToolTip();
     myToolTip.IsBalloon = true;
     myToolTip.Show(string.Empty, this, 0);
     myToolTip.Show(Msg, this, this.Width / 2, this.Height, 3000);
     this.Focus();
 }
예제 #4
0
 private void btn_MouseHover(object sender, EventArgs e)
 {
     DevExpress.XtraEditors.SimpleButton btn = (DevExpress.XtraEditors.SimpleButton)sender;
     System.Windows.Forms.ToolTip        tt  = new System.Windows.Forms.ToolTip();
     if (pbl.kiemtratinhtrang(btn.Text))
     {
         tt.Show(settooltip(btn, true), btn);
     }
     else
     {
         tt.Show(settooltip(btn, false), btn);
     }
 }
예제 #5
0
파일: Form1.cs 프로젝트: Inndy/BeanfunLogin
        public void ShowToolTip(IWin32Window ui, string title, string des, int iniDelay = 2000, bool repeat = false)
        {
            if (Properties.Settings.Default.showTip || repeat)
            {
                ToolTip toolTip = new ToolTip();
                toolTip.ToolTipTitle = title;
                toolTip.UseFading = true;
                toolTip.UseAnimation = true;
                toolTip.IsBalloon = true;
                toolTip.InitialDelay = iniDelay;

                toolTip.Show(string.Empty, ui, 3000);
                toolTip.Show(des, ui);
            }
        }
예제 #6
0
        void FSearchTextBoxMouseEnter(object sender, EventArgs e)
        {
            string tip = "Separate tags by <space>:\n\n";

            tip += "<\t Search globally in the whole node graph\n";
            tip += ">\t Search in patches within the active patch\n";
            tip += "----\n";
            tip += "#\t Search in Node IDs\n";
            tip += "l\t Search in Labels (descriptive names)\n";
            tip += "----\n";
            tip += "n\t Native nodes\n";
            tip += "m\t Modules\n";
            tip += "p\t vvvv Plugins\n";
            tip += "d\t vvvv Dynamic Plugins\n";
            tip += "x\t Effects\n";
            tip += "f\t Freeframes Plugins\n";
            tip += "v\t VST Plugins\n";
            tip += "a\t all Addons\n";
            tip += "i\t IOBoxes (Pins of Patches/Modules)\n";
            tip += "e\t exposed IOBoxes\n";
            tip += "s\t Send/Receive Nodes\n";
            tip += "/\t Comments\n";
            tip += "t\t Patches\n";
            tip += "r\t Red (missing) Nodes\n";
            tip += "b\t Boygrouped Nodes\n";
            tip += "w\t Windows";

            FTooltip.Show(tip, FSearchTextBox, new Point(0, FSearchTextBox.Height));
        }
예제 #7
0
 public static void SetMsg(string str, IWin32Window win)
 {
     ToolTip toolTip = new ToolTip();
     toolTip.IsBalloon = true;
     toolTip.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
     toolTip.Show(str, win, 0, -75, 5000);//toolTip.Show(str, win, 0, -70, 5000);
 }
예제 #8
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text) || textBox1.Text.Length < 3)
            {
                textBox1.Focus();
                var tip = new ToolTip();
                tip.SetToolTip(textBox1, "Fyll ut tittel på varen det registreres svinn på");
                tip.Show("Varen må ha en tittel", textBox1);
                return;
            }

            var svinn = new Svinn
            {
                Sum = numericUpDown1.Value,
                DatoTidspunkt = dateTimePicker1.Value,
                Kommentar = richTextBox1.Text,
                Navn = textBox1.Text,
                RegistrertTidspunkt = DateTime.Now
            };

            var context = new SalgDbContext();

            //TODO lagre svinn
            context.Svinn.Add(svinn);
            context.SaveChanges();
            Dispose();
        }
예제 #9
0
 private void BodyButton_MouseHover(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(RequestedAsapuNames))
     {
         RequestAsapuTooltip.Show(RequestedAsapuNames, toolTipParent, Cursor.Position.X - toolTipParent.Location.X + 15, Cursor.Position.Y - toolTipParent.Location.Y + 20, 10000);
     }
 }
예제 #10
0
파일: Form2.cs 프로젝트: Jacketbg/firemon
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0)
            {
                ToolTip tip = new ToolTip();
                tip.IsBalloon = true;
                tip.ToolTipIcon = ToolTipIcon.Error;
                tip.ToolTipTitle = "Грешка!";
                tip.Show("Моля въведете IP адрес или Hostname!", textBox1, 0, -65, 1000);
                textBox1.Focus();
                return;
            }

            if (firstrun)
            {
                dataSet1.Tables["settings"].Rows[0]["first_run"] = false;
            }
            //dataSet1.Tables["settings"].Rows[0]["hist"] = numericUpDown2.Value;
            //dataSet1.Tables["settings"].Rows[0]["upper_limit"] = numericUpDown4.Value;
            //dataSet1.Tables["settings"].Rows[0]["lower_limit"] = numericUpDown3.Value;

            dataSet1.AcceptChanges();
            string xmlfile = Application.StartupPath + "\\db.xml";
            dataSet1.WriteXml(xmlfile);
            //Form1 f1 = new Form1();
            //f1.reload_db();
            //f1.Show();
            //Application.Restart();
            f1.dataSet1 = (DataSet1)dataSet1.Copy();
            f1.reload_db();
            this.Close();
        }
예제 #11
0
        private void buttonX_test_connection_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.sHost = uiTBSettingHost.Text;
            Properties.Settings.Default.sDB = uiTBSettingDB.Text;
            Properties.Settings.Default.sUser = uiTBSettingUser.Text;
            Properties.Settings.Default.sPassword = uiTBSettingPassword.Text;

            Properties.Settings.Default.Save();

            if (DataManager.Initialize(Properties.Settings.Default.sHost, Properties.Settings.Default.sDB, Properties.Settings.Default.sUser, Properties.Settings.Default.sPassword))
            {

                DialogResult = DialogResult.OK;

            }
            else
            {
                const int visibleTime = 3 * 1000; //in milliseconds

                var tt1 = new ToolTip();
                tt1.Show("Please, enter a valid data.", uiTBSettingHost, 0, -20, visibleTime);

                var tt2 = new ToolTip();
                var tt3 = new ToolTip();
                var tt4 = new ToolTip();

                tt2.Show("Please, enter a valid data.", uiTBSettingDB, 0, -20, visibleTime);
                tt3.Show("Please, enter a valid data.", uiTBSettingUser, 0, -20, visibleTime);
                tt4.Show("Please, enter a valid data.", uiTBSettingPassword, 0, -20, visibleTime);
            }
        }
예제 #12
0
        private void listview_largeicon_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            System.Windows.Forms.ListViewItem lv = this.listview_largeicon.GetItemAt(e.X, e.Y);

            if (lv != null)
            {
                if (pointView.X != e.X || pointView.Y != e.Y)//防止闪烁

                {
                    string str_temp   = lv.SubItems[0].Text.Replace("#", "");
                    int    index_temp = mysqlID_to_listID(ellipse_list_tab4, Convert.ToInt16(str_temp));

                    toolTip_tab3.Show(ellipse_list_tab2[index_temp].ToolTip.ToString(), listview_largeicon, new System.Drawing.Point(e.X, e.Y), 10000);

                    pointView.X = e.X;

                    pointView.Y = e.Y;

                    toolTip_tab3.Active = true;
                }
            }
            else
            {
                toolTip_tab3.Hide(listview_largeicon);
            }
        }
예제 #13
0
 private void MostratToolTip(bool es)
 {
     if (es)
     {
         tt.ToolTipIcon  = System.Windows.Forms.ToolTipIcon.Info;
         tt.ToolTipTitle = "Email Valido";
         tt.Show("El email ingresado si es valido.", this, this.Width + 20, -20, 5000);
         this.BackColor = System.Drawing.Color.LightGreen;
     }
     else
     {
         tt.ToolTipIcon  = System.Windows.Forms.ToolTipIcon.Error;
         tt.ToolTipTitle = "Email Invalido";
         tt.Show("El email ingresado no es valido.", this, this.Width + 20, -20, 5000);
         this.BackColor = System.Drawing.Color.Red;
     }
 }
 private void saveButton_Click(object sender, EventArgs e)
 {
     Properties.Settings.Default.Save();
     ToolTip tooltip = new ToolTip();
     tooltip.ToolTipTitle = "Successful";
     tooltip.Show("Options Saved Successfully!", saveButton, 3000);
     tooltip.IsBalloon = true;
 }
        private void dataEvents_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataEvents.Columns[e.ColumnIndex] == this.eventListeners)
            {
                var cell = this.dataEvents.Rows[e.RowIndex].Cells[this.eventName.Name];
                var toolTipText = this.GetEventListenersText(cell.Value.ToString());

                var tt = new ToolTip();
                tt.Show(toolTipText, this, this.PointToClient(Cursor.Position), 5000);
            }
        }
예제 #16
0
 private void ShowToolTip(string text, int x, int y)
 {
     if (FToolTip == null)
     {
         FToolTip = new System.Windows.Forms.ToolTip();
     }
     if (FToolTip != null)
     {
         FToolTip.Show(text, this, x, y);
     }
 }
 private void dataGridView1_MouseCellEnter(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex != -1 && e.RowIndex != -1)
     {
         this.SuspendLayout();
         var   rectC        = dataGridView1.GetColumnDisplayRectangle(e.ColumnIndex, true);
         var   left         = rectC.Left + (int)(rectC.Width * .5f);
         var   rectR        = dataGridView1.GetRowDisplayRectangle(e.RowIndex, true);
         var   top          = (rectR.Top + (int)(rectR.Height * .5f));
         Point displayPoint = new Point(left + this.ClientRectangle.Left, top + this.ClientRectangle.Top + 40);
         var   column       = e.ColumnIndex;
         var   row          = e.RowIndex;
         for (int i = 0; i < 5; ++i)
         {
             ttText.Show(dataGridView1[column, row].Value.ToString(), this, displayPoint);
             ttText.Hide(this);
         }
         ttText.Show(dataGridView1[column, row].Value.ToString(), this, displayPoint);
         this.ResumeLayout();
     }
 }
예제 #18
0
        private bool checkOne(TextBox input) //проверка одного поля
        {
            bool result = true;

            if (input.Text == "")
            {
                result = false;
                ToolTip req = new System.Windows.Forms.ToolTip();
                req.Show("Заполните это поле", input, 1000);
            }
            return(result);
        }
예제 #19
0
 private void btn_save_Click(object sender, EventArgs e)
 {
     if (textBoxX_contract_name.Text != "")
     {
         DialogResult = DialogResult.OK;
     }
     else
     {
         var tt1 = new ToolTip();
         tt1.Show("Please, enter name of contract.", textBoxX_contract_name, 0, -20, 3000);
     }
 }
예제 #20
0
        private void textBoxBookName_TextChanged(object sender, EventArgs e)
        {
            MatchCollection matches = regexalpha.Matches(textBoxBookName.Text);

            if (matches.Count != textBoxBookName.Text.Length) {
                textBoxBookName.Text = textBoxBookName.Text.Substring(0, textBoxBookName.Text.Length - 1);
                textBoxBookName.Focus();
                textBoxBookName.SelectionStart = textBoxBookName.Text.Length;

                ToolTip tooltip = new ToolTip();
                tooltip.Show("Only alphabets are allowed", textBoxBookName, 50, 0, 1000);
            }
        }
예제 #21
0
        public void ExibirErro(String Erro, String NomeDoControle)
        {
            Control ctrl = this.Controls.Find(NomeDoControle, true)[0];
            ToolTip tt = new ToolTip();
            tt.ToolTipIcon = ToolTipIcon.Error;
            tt.ToolTipTitle = "Erro!";

            try
            {
                tt.Show(Erro, ctrl);
            }
            catch (NullReferenceException)
            {
                // Se não achar o controle chama a exceção convencional
                this.ExibirErro(Erro);
            }
        }
예제 #22
0
 private void textBoxX_contract_name_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
         DialogResult = DialogResult.Cancel;
     if (e.KeyCode == Keys.Enter)
     {
         if (textBoxX_contract_name.Text != "")
         {
             DialogResult = DialogResult.OK;
         }
         else
         {
             var tt1 = new ToolTip();
             tt1.Show("Please, enter name of contract.", textBoxX_contract_name, 0, -20, 3000);
         }
     }
 }
예제 #23
0
 private void linkLblFromUrl_MouseEnter(object sender, EventArgs e)
 {
     if (!controlToolTip && toolTipFromUrl != null)
     {
         IntSecurity.AllWindows.Assert();
         try
         {
             controlToolTip = true;
             toolTipFromUrl.Show(linkLblFromUrl.Text, linkLblFromUrl);
             UnsafeNativeMethods.SendMessage(new HandleRef(toolTipFromUrl, toolTipFromUrl.Handle), NativeMethods.TTM_SETMAXTIPWIDTH, 0, 600);
         }
         finally
         {
             System.Security.CodeAccessPermission.RevertAssert();
             controlToolTip = false;
         }
     }
 }
예제 #24
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (wowPathInput.Text != "")
            {
                if (System.IO.File.Exists(wowPathInput.Text + "\\wow.exe") == true)
                {
                    WriteSettingsFile xmlWrite = new WriteSettingsFile();
                    xmlWrite.Load();

                    xmlWrite.SetWoWPath(wowPathInput.Text);
                    if (startUpSoundCheckBox.Checked == true)
                    {
                        xmlWrite.SetStartUpSound(true);
                    }
                    else
                    {
                        xmlWrite.SetStartUpSound(false);
                    }

                    if (minimizeToTrayCheckBox.Checked == true)
                    {
                        xmlWrite.MinimizeToTray(true);
                    }
                    else
                    {
                        xmlWrite.MinimizeToTray(false);
                    }

                    Form3.ActiveForm.Hide();
                }
                else
                {
                    MessageBox.Show("ERROR: can't find wow.exe in: \n\n '" + wowPathInput.Text + "\' \n\n Please choose another directory.", "Error!");
                }
            }
            else
            {
                ToolTip errorTip = new ToolTip();
                errorTip.IsBalloon = true;
                errorTip.Show("Field cannot be empty!", wowPathInput, 5, -35, 1500);
                //wowPathInput.
            }
        }
예제 #25
0
        void ToolTipListBox_MouseHover( object sender, EventArgs e ) {
            ListBoxEntry entry = DetermineHoveredItem();
            if ( entry == null ) {
                if ( currentToolTip != null ) {
                    currentToolTip.Hide( this );
                    currentToolTip.Dispose();
                }
                return;
            }


            currentToolTip = new ToolTip() {
                ToolTipTitle = entry.Text,
                ToolTipIcon = ToolTipIcon.Info
            };
            Point drawLocation = PointToClient( ListBox.MousePosition );
            drawLocation.Offset(8, 8);
            currentToolTip.Show( entry.HoverText, this, drawLocation);
        }
예제 #26
0
        private void pictureBoxIcon_MouseEnter(object sender, EventArgs e)
        {
            string classre = "";

            if (ucAbility.ClassReq == Core.EnumAbilityClassReq.ANY)
            {
                classre = "Can be used by any class";
            }

            else
            {
                classre = "Can be used by the " + ucAbility.ClassReq.ToString().ToLower() + " class.";
            }


            toolTip.ForeColor    = Color.Yellow;
            toolTip.ToolTipTitle = ucAbility.AbilityName;
            toolTip.Show(ucAbility.Description + "\n\n" + classre, pictureBoxIcon, 5000);
        }
예제 #27
0
        private void chart1_MouseClick(object sender, MouseEventArgs e)
        {
            ToolTip toolTip = new System.Windows.Forms.ToolTip();

            toolTip.Draw += new System.Windows.Forms.DrawToolTipEventHandler(this.toolTip_Draw);
            Point  chartLocationOnForm = chart1.FindForm().PointToClient(chart1.Parent.PointToScreen(chart1.Location));
            double x = chart1.ChartAreas[0].CursorX.Position;
            double y = chart1.ChartAreas[0].CursorY.Position;

            toolTip.OwnerDraw = true;
            toolTip.ForeColor = System.Drawing.Color.Green;
            toolTip.BackColor = System.Drawing.Color.Black;

            toolTip.UseAnimation = false;
            toolTip.UseFading    = false;

            string s = comboBox1.Text;

            toolTip.Show(s.Substring(0, 1), this.chart1, e.Location.X, e.Location.Y);
            tools.Add(toolTip);
        }
예제 #28
0
파일: Batch.cs 프로젝트: Wyvern/ImageRipper
 private void btnSet_Click(object sender, EventArgs e)
 {
     var ripper = this.Owner as Main;
     if (udFrom.Value > 0 && udFrom.Value < udTo.Value)
     {
         ripper.From = decimal.ToInt32(udFrom.Value); ripper.To = decimal.ToInt32(udTo.Value);
         var n = _seed.ToString();
         var m = ripper.Address.LastIndexOf(n);
         ripper.Address = ripper.Address.Substring(0, m) + ripper.From.ToString() + ripper.Address.Substring(m + n.Length);
         ripper.Batch = true;
         ripper.Range = ripper.To - ripper.From + 1;
         Close();
     }
     else
     {
         var tt = new ToolTip();
         tt.IsBalloon = true;
         tt.ToolTipIcon = ToolTipIcon.Warning;
         tt.ToolTipTitle = "Invalid Range";
         tt.Show("Out of range values", lblCaption, 2000);
     }
 }
예제 #29
0
        public static void tooltip_graph_display(System.Windows.Forms.ToolTip t, System.Windows.Forms.MouseEventArgs e, Chart c, System.Drawing.Point?p)
        {
            t.RemoveAll();
            System.Drawing.Point pos = e.Location;
            if (p.HasValue && pos == p.Value)
            {
                return;
            }

            System.Windows.Forms.DataVisualization.Charting.HitTestResult[] results = new System.Windows.Forms.DataVisualization.Charting.HitTestResult[4];

            try
            {
                results = c.HitTest(pos.X, pos.Y, false, ChartElementType.DataPoint);

                foreach (System.Windows.Forms.DataVisualization.Charting.HitTestResult result in results)
                {
                    if (result.ChartElementType == ChartElementType.DataPoint)
                    {
                        DataPoint prop = result.Object as DataPoint;
                        if (prop != null)
                        {
                            double pointXPixel = result.ChartArea.AxisX.ValueToPixelPosition(prop.XValue);
                            double pointYPixel = result.ChartArea.AxisY.ValueToPixelPosition(prop.YValues[0]);

                            // check if the cursor is really close to the point (2 pixels around the point)
                            if (Math.Abs(pos.X - pointXPixel) < 2) //&& Math.Abs(pos.Y - pointYPixel) < 2)
                            {
                                t.Show("X=" + prop.XValue + ", Y=" + prop.YValues[0], c, pos.X, pos.Y - 15);
                            }
                        }
                    }
                }
            }
            catch
            { }
        }
예제 #30
0
        protected override void OnMouseHover(EventArgs e)
        {
            base.OnMouseHover(e);

            var mclient = PointToClient(MousePosition);

            hoveredNode = GetNodeAt(mclient);
            if (hoveredNode != null)
            {
                if (ShowNodeToolTips)
                {
                    if (!string.IsNullOrEmpty(hoveredNode.ToolTipText))
                    {
                        if (nodeToolTip == null)
                        {
                            nodeToolTip = new ToolTip();
                            nodeToolTip.InitialDelay = 0;
                        }

                        if (hoveredNode != nodeToolTipLast)
                        {
                            nodeToolTip.Show(hoveredNode.ToolTipText, mclient);
                        }

                        nodeToolTipLast = hoveredNode;
                    }
                    else
                    {
                        nodeToolTipLast = null;
                    }
                }

                // Tooltip will show previous ToolTipText. Override OnMouseHover if necessary.
                OnNodeMouseHover(new TreeNodeMouseHoverEventArgs(hoveredNode));
            }
        }
예제 #31
0
        void TopButtonEnter(object sender, EventArgs e)
        {
            var    b    = (sender as Button);
            string text = "";

            if (b == FTagButton)
            {
                text = "Browse nodes by tags";
            }
            else if (b == FCategoryButton)
            {
                text = "Browse nodes by category";
            }
            else if (b == FGirlpowerButton)
            {
                text = "Browse girlpower demos";
            }
            else if (b == FFilterButton)
            {
                text = "Set node category filter";
            }

            FToolTip.Show(text, this, b.Left, b.Bottom + 10);
        }
예제 #32
0
        internal void NotificarArchivo(ArchivoSOA archivoSOA)
        {
            if (Contenedor.InvokeRequired)
            {
                Contenedor.BeginInvoke(new SetLabelTextDelegate(NotificarArchivo),
                                                            new object[] { archivoSOA });

                return;
            }
            _archivos.Add(archivoSOA);
            string mensaje =
            "Hora: " + archivoSOA.Fecha.ToString() + Environment.NewLine +
            "Nombre: " + archivoSOA.FileName + Environment.NewLine +
            "Tamaño: " + archivoSOA.Length.ToString() + " bytes" + Environment.NewLine +
            "Puerto Origen: " + archivoSOA.SourcePort.ToString() + Environment.NewLine +
            "Puerto Destino: " + archivoSOA.DestinationPort.ToString();
            ToolTip toolTip = new ToolTip();
            toolTip.ToolTipIcon = ToolTipIcon.Info;
            toolTip.ToolTipTitle = "Archivo Recibido";
            toolTip.Show(mensaje, base.Contenedor.Window, DimensionMundo.Centro.X, DimensionMundo.Centro.Y, 9000);
        }
예제 #33
0
        public void treeView1_NodeMouseHover(object sender, TreeNodeMouseHoverEventArgs e)
        {
            TreeNode node = e.Node;

            if (node == null ||
                (!(node.Tag is ModuleDefMD) && !(node.Tag is TypeDef) && !(node.Tag is MethodDef) &&
                 !(node.Tag is PropertyDef) && !(node.Tag is FieldDef) && !(node.Tag is EventDef)) ||
                node.ToolTipText != string.Empty)
            {
                return;
            }

            NodeToolTip.Active = false;
            NodeToolTip.Dispose();
            NodeToolTip = new ToolTip();

            if (node.Tag is ModuleDefMD)
            {
                var module = node.Tag as ModuleDefMD;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", module.MDToken.FullMetadataTokenString(), module.MDToken.Rid, module.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }

            else if (node.Tag is TypeDef)
            {
                var type = node.Tag as TypeDef;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", type.MDToken.FullMetadataTokenString(), type.MDToken.Rid, type.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }

            else if (node.Tag is MethodDef)
            {
                var method = node.Tag as MethodDef;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", method.MDToken.FullMetadataTokenString(), method.MDToken.Rid, method.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }

            else if (node.Tag is PropertyDef)
            {
                var property = node.Tag as PropertyDef;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", property.MDToken.FullMetadataTokenString(), property.MDToken.Rid, property.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }

            else if (node.Tag is FieldDef)
            {
                var field = node.Tag as FieldDef;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", field.MDToken.FullMetadataTokenString(), field.MDToken.Rid, field.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }

            else if (node.Tag is EventDef)
            {
                var @event = node.Tag as EventDef;
                string text = string.Format(
            @"MDToken: 0x{0}
            RID: {1}
            FullName: {2}", @event.MDToken.FullMetadataTokenString(), @event.MDToken.Rid, @event.FullName);

                node.ToolTipText = text;
                NodeToolTip.Show(text, CurrentTreeView);
            }
        }
예제 #34
0
        private void textBoxQuantity_TextChanged(object sender, EventArgs e)
        {
            MatchCollection matches = regexnumeric.Matches(textBoxQuantity.Text);

            if (matches.Count != textBoxQuantity.Text.Length) {
                textBoxQuantity.Text = textBoxQuantity.Text.Substring(0, textBoxQuantity.Text.Length - 1);
                textBoxQuantity.Focus();
                textBoxQuantity.SelectionStart = textBoxQuantity.Text.Length;

                ToolTip tooltip = new ToolTip();
                tooltip.Show("Only numerics are allowed", textBoxQuantity, 50, 0, 1000);
            }
        }
 private void textBoxPollingInterval_TextChanged(object sender, EventArgs e)
 {
     if (!this.pollingIntervalIsValid(this.textBoxPollingInterval.Text)) {
         ToolTip toolTip = new ToolTip();
         toolTip.IsBalloon = true;
         toolTip.ToolTipIcon = ToolTipIcon.Error;
         toolTip.ToolTipTitle = "Incorrect value";
         toolTip.Show("Value for Polling Interval must be a number between 1 and 999.", this.textBoxPollingInterval, 0, -74, 5000);
     }
     this.updateSaveButtonState();
 }
 private void textBoxIPAddress_TextChanged(object sender, EventArgs e)
 {
     if (!this.ipAddressIsValid(this.textBoxIPAddress.Text)) {
         ToolTip toolTip = new ToolTip();
         toolTip.IsBalloon = true;
         toolTip.ToolTipIcon = ToolTipIcon.Error;
         toolTip.ToolTipTitle = "Incorrect value";
         toolTip.Show("Value for IP Address must be a valid IPv4 address.", this.textBoxIPAddress, 0, -74, 3000);
     }
     this.updateSaveButtonState();
 }
예제 #37
0
        private void ValidateTextboxInput(TextBox box, KeyPressEventArgs e, Range r)
        {
            ToolTip tt = new ToolTip();
            string tooltipString = string.Format("Only numbers between {0} - {1} are accepted", r.Lower, r.Upper);

            if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
            {
                tt.Show(tooltipString, box, 50, -20, 1000);
                e.Handled = true;
                return;
            }

            if (char.IsControl(e.KeyChar))
            {
                return;
            }

            int selectedLength = box.SelectionLength;
            string boxEntry = box.Text;
            if (selectedLength > 0)
            {
                boxEntry = boxEntry.Remove(boxEntry.Length - selectedLength);
            }

            if (r.Lower > 1 && boxEntry.Length == 0)
            {
                if (int.Parse(e.KeyChar + "0") < r.Lower)
                {
                    tt.Show(tooltipString, box, 50, -20, 1000);
                    e.Handled = true;
                }

                return;
            }

            int attempedEntry = int.Parse(boxEntry + e.KeyChar);
            if (attempedEntry > r.Upper || attempedEntry < r.Lower)
            {
                tt.Show(tooltipString, box, 50, -20, 1000);
                e.Handled = true;
            }
        }
        //occurs when patient personal details text boxes changed, limit length to 20.
        private void SmallDetailsTextBox_TextChanged(object sender, EventArgs e)
        {
            TextBox changedTextBox = sender as TextBox;
            string s = changedTextBox.Text;

            if (s.Length > 20)
            {
                string errorText = "Maximum 20 Characters";
                s = s.Substring(0, s.Length - 1);
                ToolTip errorToolTip = new ToolTip();
                errorToolTip.SetToolTip(idToLoadTextBox, "digit only");
                errorToolTip.Show(errorText, idToLoadTextBox, 800);
                changedTextBox.Text = s;
                changedTextBox.Focus();
                changedTextBox.SelectionStart = changedTextBox.Text.Length;
            }
        }
예제 #39
0
        private void textBoxUT_MouseHover(object sender, EventArgs e)
        {
            ToolTip tip = new ToolTip();

            tip.IsBalloon = false;
            tip.ReshowDelay = 0;
            tip.Show("Horas que se añaden al sismo", panel1, 1200);
        }
예제 #40
0
        void Dibujo(Panel pan,ushort id, int[] va)
        {
            /*
             * Rutina que dibuja toda la traza de la estacion seleccionada y la cual sirve de
             * referencia para la clasificacion. id corresponde al numero de traza de la estacion
             * seleccionada. La variable 'va' contiene los datos de las cuentas (aqui la traza puede
             * estar filtrada o no). La variable tim, contiene el valor del tiempo en formato SUDS.
             * denom: variable que guarda el numero de lineas para graficar.
            */
            int i, xf, yf, ix, iy, jj, k, kk, ini, fin, pro, denom, max, min, mxx, mnn, dif = 0;
            int tota, inicio, final,mxp,mnp,cuentana;
            long ll;
            int[] numda;
            float fax, fay, fayy, fy, fsatu, iniy, x1 = 0, y1 = 0, diff, ff, fxsat, fmsat;
            double dd;
            string esta = "", ca = "", ss = "";
            ToolTip tip = new ToolTip();
            Color col,col2;
            Point[] dat;

            if (nutra == 0 || cargar == false) return;
            if (pan == panel1)
            {
                col = colotr1;
                col2 = colfondo;
            }
            else
            {
                col = Color.DarkGoldenrod;
                if (colfondo != Color.Black) col2 = Color.Linen;
                else col2 = Color.DarkGray;
            }
            mxp = 0; mnp = 0;
            if (!char.IsLetterOrDigit(est[id][1]) && !char.IsLetterOrDigit(est[id][2])) return;

            try
            {
                pan.BackColor = col2;
                util.borra(pan, col2);
                if (pan == panel1a) tota = va.Length - M;
                else tota = va.Length;
                if (tim[id][tota - 1] <= 0)
                {
                    do
                    {
                        tota -= 1;
                        if (tim[id][tota - 1] > 0) break;
                    } while (tota > 0);
                }
                jj = 0;
                if (tota < 2) return;
                dd = totven * 60.0;
                denom = (int)(Math.Abs(Math.Ceiling((tim[id][tota-1]-timin)/dur)));
                if (denom<=0) denom=1;

                // En el caso que sipro=2, es porque se ha buscado el promedio de un sector de traza,
                // el cual esta comprendido entre la muestra p1 y la p2.
                if (sipro == 2)
                {
                    inicio = p1;
                    final = p2;
                    mxp = va[inicio];
                    mnp = mxp;
                    for (k = inicio + 1; k < final; k++)
                    {
                        if (mxp < va[k]) mxp = va[k];
                        else if (mnp > va[k]) mnp = va[k];
                    }
                }
                if (filt == true) inicio = 250;
                else
                {
                    if (pan == panel1a) inicio = M;
                    else inicio = 1;
                }
                xf = pan.Size.Width;
                yf = pan.Size.Height;
                numda = new int[denom];
                for (k = 0; k < denom; k++) numda[k] = 0;

                if (esp == 0) fay = (float)((yf-45.0F)/(double)(denom));
                else fay = esp;
                if (analogico == false) fayy = fay;// provi
                else
                {
                    cuentana = CuentasAnalogico;
                    if (nuanalog > 0)
                    {
                        for (i = 0; i < nuanalog; i++)
                        {
                            if (string.Compare(est[id], 0, estanalog[i], 0, 4) == 0)
                            {
                                cuentana = analog[i];
                                break;
                            }
                        }
                    }
                    fayy = (float)(100.0 / (cuentana * ga[id]));//provi
                }
                fax = xf / dur;
                max = va[inicio];
                min = max;
                for (k = inicio + 1; k < tota; k++)
                {
                    if (max < va[k]) max = va[k];
                    else if (min > va[k]) min = va[k];
                }
                for (k = inicio+1; k < tota; k++)
                {
                    jj = (int)((tim[id][k]-timin)/dur);
                    if (jj > denom || jj < 0) continue;

                    if (jj > -1)
                    {
                        if (jj >= denom) break;
                        numda[jj] += 1;
                    }
                }
                if (sipro == 2) pro = (int)((mxp + mnp) / 2.0);
                else
                {
                    if (PROMEDIO <= 0) pro = (int)((max + min) / 2.0F);
                    else
                    {
                        mxx = va[0];
                        mnn = mxx;
                        for (i = 1; i < PROMEDIO; i++)
                        {
                            if (mxx < va[i]) mxx = va[i];
                            else if (mnn > va[i]) mnn = va[i];
                        }
                        pro = (int)((mxx + mnn) / 2.0);
                    }
                }
                //if (est[id].Substring(0, 4) == "GREZ") MessageBox.Show("sipro="+sipro.ToString()+" pro="+pro.ToString());
                if (analogico == false)
                {
                    if (max-pro!=0) fy=((fayy/2)/((max-pro)));
                    else fy=1;
                }
                else fy = fayy;
                if (est[id].Length>4 && !char.IsLetterOrDigit(est[id][4])) esta = est[id].Substring(0, 4);
                else esta = est[id];
                //promEst[id] = pro;

                if (max - pro != 0) fsatu = ((fay / 2) / ((max - pro)));
                else fsatu = 1;
                dif = max - pro;
                diff = dif * fsatu;
                fxsat = (float)(diff+satur*diff*0.5);   // fxsat y fmsat, son variables para la opcion de saturacion.
                dif = min - pro;
                diff = dif * fsatu;
                fmsat = (float)(diff+satur*diff*0.5);

                Graphics dc = pan.CreateGraphics();
                Pen lapiz = new Pen(colinea, 1);
                SolidBrush brocha = new SolidBrush(col);
                SolidBrush brocha2 = new SolidBrush(Color.OrangeRed);
                SolidBrush brocha3 = new SolidBrush(Color.Green);
                SolidBrush brocha4 = new SolidBrush(Color.Goldenrod);
                SolidBrush brocha5 = new SolidBrush(Color.Gray);

                kk = 0; iniy = 0;
                ll = (long)(Fei + timin * 10000000.0);
                DateTime fech = new DateTime(ll);
                ss = string.Format("{0:yyyy}/{0:MM}/{0:dd} {0:HH}:{0:mm}:{0:ss}", fech);
                dc.DrawString(ss, new Font("Times New Roman", 10), brocha2, 3, 3);
                ss = "(" + totven.ToString() + "' )";
                dc.DrawString(ss, new Font("Times New Roman", 10), brocha3, 115, 3);
                ss = "[" + esp.ToString() + "]";
                dc.DrawString(ss, new Font("Times New Roman", 10), brocha4, 145, 3);
                ss = "usuario: " + usu;
                dc.DrawString(ss, new Font("Times New Roman", 10), brocha5, 170, 3);
                ca = "";
                if (no30[id] == true) ca = "## ";
                if (siTraslapo[id] == true) ca += "!!   ";
                ca += esta + "   (" + tar[id] + ")";
                if (siRoto[id] == true) ca += "   !! ";
                dc.DrawString(ca, new Font("Times New Roman", 12, FontStyle.Bold), brocha, xf / 2 - 50, 10);
                if (invertido[id] == true)
                {
                    Pen lapp = new Pen(Color.Black, 1);
                    SolidBrush broo = new SolidBrush(Color.Yellow);
                    dc.FillEllipse(broo,xf/2-37,15, 8, 8);
                    dc.DrawEllipse(lapp,xf/2-37,15,8,8);
                    lapp.Dispose();
                    broo.Dispose();
                }
                ca = string.Format("{0:0.000} m/s", ra[id]);
                dc.DrawString(ca, new Font("Times New Roman", 10), brocha5, xf - 100, 10);

                ini = inicio;

                try
                {
                    for (k = 0; k < denom; k++)
                    {
                        if (numda[k] > 0)
                        {
                            jj = 0;
                            dat = new Point[numda[k]];
                            fin = ini + numda[k];
                            if (fin > tota) fin = tota;
                            iniy = incy + 45 + k * fay + fay / 2;
                            //Pen laaa = new Pen(Color.Red, 1);
                            //dc.DrawLine(laaa, 1, iniy, xf, iniy);
                            //laaa.Dispose();
                            if (satu == false)
                            {
                                if (invertido[id] == false)
                                {
                                    for (kk = ini; kk < fin; kk++)
                                    {
                                        //dif = va[kk] - pro;
                                        dif = va[kk] - promEst[id];
                                        diff = dif * fy;
                                        ff = ampli * diff;
                                        y1 = iniy - ff;
                                        x1 = (float)(((tim[id][kk] - timin) - k * dur) * fax);
                                        dat[jj].Y = (int)(y1);
                                        dat[jj].X = (int)x1;
                                        jj += 1;
                                    }
                                }
                                else
                                {
                                    for (kk = ini; kk < fin; kk++)
                                    {
                                        //dif = pro-va[kk];
                                        dif = promEst[id] - va[kk];
                                        diff = dif * fy;
                                        ff = ampli * diff;
                                        y1 = iniy - ff;
                                        x1 = (float)(((tim[id][kk] - timin) - k * dur) * fax);
                                        dat[jj].Y = (int)(y1);
                                        dat[jj].X = (int)x1;
                                        jj += 1;
                                    }
                                }
                            }
                            else
                            {
                                if (invertido[id] == false)
                                {
                                    for (kk = ini; kk < fin; kk++)
                                    {
                                        //dif = va[kk] - pro;
                                        dif = va[kk] - promEst[id];
                                        diff = dif * fy;
                                        ff = ampli * diff;
                                        if (ff > fxsat) ff = fxsat;
                                        else if (ff < fmsat) ff = fmsat;
                                        y1 = iniy - ff;
                                        x1 = (float)(((tim[id][kk] - timin) - k * dur) * fax);
                                        dat[jj].Y = (int)(y1);
                                        dat[jj].X = (int)x1;
                                        jj += 1;
                                    }
                                }
                                else
                                {
                                    for (kk = ini; kk < fin; kk++)
                                    {
                                        //dif = pro-va[kk];
                                        dif = promEst[id] - va[kk];
                                        diff = dif * fy;
                                        ff = ampli * diff;
                                        if (ff > fxsat) ff = fxsat;
                                        else if (ff < fmsat) ff = fmsat;
                                        y1 = iniy - ff;
                                        x1 = (float)(((tim[id][kk] - timin) - k * dur) * fax);
                                        dat[jj].Y = (int)(y1);
                                        dat[jj].X = (int)x1;
                                        jj += 1;
                                    }
                                }
                            }
                            dc.DrawLines(lapiz, dat);
                            ini += numda[k];
                        }
                    }
                }
                catch
                {
                }

                if (kk > 0 && iniy > 0 && iniy < yf)
                {
                    if (x1 < xf - 110) ix = (int)(x1);
                    else ix = xf - 110;
                    if (esp == 0) iy = yf - 20;
                    else iy = (int)(iniy + fay);
                    ll = (long)(Fei + tim[id][kk - 1] * 10000000.0);
                    DateTime fech2 = new DateTime(ll);
                    ss = string.Format("{0:yyyy}/{0:MM}/{0:dd} {0:HH}:{0:mm}:{0:ss}", fech2);
                    dc.DrawString(ss, new Font("Times New Roman", 10), brocha2, ix, iy);
                }

                lapiz.Dispose();
                brocha.Dispose();
                brocha2.Dispose();
                brocha3.Dispose();
                brocha4.Dispose();
                brocha5.Dispose();
                try
                {
                    if (marcati == true) util.MarcaTiempo(pan,timin,tim[id],esp,dur,denom);
                }
                catch
                {
                }
                if (pepas == true || pepasvol == true)
                {
                    util.PonePepas(pan, timin, tim[id], esp, dur, contampl, valampl, clR, clG, clB,
                        letampl, cl, tam, nucla, siPampl, volampl, volcan[vol][0], pepasvol, nolec,
                           tigrabacion,leclec,denom);
                }
                // la variable siArch, es verdadera cuando se quiere visualizar la extension de los
                // archivos clasificados en la traza de la estacion activa. Se visualiza con la rutina
                // VerArchi, que se encuentra en las utilidades (Util.cs)
                if (siArch == true) util.VerArchi(pan, timin, tim[id], tiar, duar, esp, dur, contarch);
            }
            catch
            {
                NoMostrar = true;
                tip.IsBalloon = false;
                tip.ReshowDelay = 0;
                tip.Show("\nPROBLEMAS!!! Tome otro archivo inicial!\n ", panel1, 1000);
            }

            return;
        }
예제 #41
0
        void maskedTextBox1_TypeValidationCompleted(object sender, TypeValidationEventArgs e)
        {
            // Create the ToolTip and associate with the Form container.
              ToolTip toolTip1 = new ToolTip();

              // Set up the delays for the ToolTip.
              toolTip1.AutoPopDelay = 1000;
              toolTip1.InitialDelay = 500;
              toolTip1.ReshowDelay = 200;
              // Force the ToolTip text to be displayed whether or not the form is active.
              toolTip1.ShowAlways = true;

              // Set up the ToolTip text for the Button.
              toolTip1.SetToolTip(this.button6, "My button6");

              if (!e.IsValidInput)
              {

              toolTip1.ToolTipTitle = "Invalid Date";
              toolTip1.Show("The data you supplied must be a valid date in the format mm/dd/yyyy.", maskedTextBox1, 0, -20, 5000);
              }
              else
              {
              //Now that the type has passed basic type validation, enforce more specific type rules.
              DateTime userDate = (DateTime)e.ReturnValue;
              if (userDate < DateTime.Now)
              {
                  toolTip1.ToolTipTitle = "Invalid Date";
                  toolTip1.Show("The date in this field must be greater than today's date.", maskedTextBox1, 0, -20, 5000);
                  e.Cancel = true;
              }
              }
        }
예제 #42
0
        private void textBoxDisparo_MouseHover(object sender, EventArgs e)
        {
            ToolTip tip = new ToolTip();

            tip.IsBalloon = false;
            tip.ReshowDelay = 0;
            tip.Show("Letra de Tarjeta para Factores", panel1, 1200);
        }
 //When save clicked, gets all patient details from textBoxs and save patient to database.
 private void _savePatientButton_Click(object sender, EventArgs e)
 {
     string testName = _testNameTextBox.Text;
     string id = _idTextBox.Text;
     string fName = _firstNameTextBox.Text;
     string lName = _lastNameTextBox.Text;
     string pathoNum = _pathologicalNoTextBox.Text;
     string runNum = _runNoTextBox.Text;
     string tumourSite = _tumorSiteTextBox.Text;
     string diseaseLevel = _diseaseLevelTextBox.Text;
     string prevTreatment = _previousTreatmentTextBox.Text;
     string currTreatment = _currentTreatmentTextBox.Text;
     string background = _backgroundTextBox.Text;
     string conclusion = _conclusionsTextBox1.Text;
     //validate textboxs text
     if (!(id.Equals("") || fName.Equals("") || lName.Equals("")))     //removed    runNum.Equals("")    || pathoNum.Equals("")  || tumourSite.Equals("")
     {
         //check if patient with same test name allready exist.
         Patient p = new Patient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, background, prevTreatment, currTreatment, conclusion);
         try
         {
             //If Exist, show message for overwriting.
             if (MainBL.patientExistByTestName(testNmae))
             {
                 if (MessageBox.Show("TEST NAME allready exist, Overwrite?", "Notice", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     MainBL.updatePatient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, background, prevTreatment, currTreatment, conclusion);
                     _mainForm.CurrPatient = p;
                     _mutationList = MainBL.getMutationListByTestName(p.TestName);
                     _mainForm.MutationList = _mutationList;
                     MessageBox.Show("Patient saved successfully");
                 }
             }
             //If not Exist, insert new patient to database.
             else
             {
                 MainBL.addPatient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, prevTreatment, currTreatment, background, conclusion);
                 _mainForm.CurrPatient = p;
                 _mainForm.MutationList = _mutationList;
                 foreach (Mutation m in _mutationList)
                 {
                     MainBL.addMatch(testName, m.MutId);
                 }
                 MessageBox.Show("Patient saved successfully");
             }
         }
         catch (Exception)
         {
             GeneralMethods.showErrorMessageBox("Something Went Wrong, Please try Again");
         }
     }
     else
     {
         ToolTip errorToolTip = new ToolTip();
         errorToolTip.SetToolTip(_savePatientButton, "digit only");
         errorToolTip.Show("Please Fill All Details", _savePatientButton, 800);
     }
     colorTextBoxs();
 }
예제 #44
0
파일: Form2.cs 프로젝트: Jacketbg/firemon
 private void textBox3_Leave(object sender, EventArgs e)
 {
     int r;
     if (!Int32.TryParse(textBox3.Text, out r))
     {
         ToolTip tip = new ToolTip();
         tip.IsBalloon = true;
         tip.ToolTipIcon = ToolTipIcon.Error;
         tip.ToolTipTitle = "Грешка!";
         tip.Show("Моля въвеждайте само цифри", textBox3, 0, -65, 1000);
         textBox3.Focus();
         return;
     }
 }
예제 #45
0
파일: Form2.cs 프로젝트: Jacketbg/firemon
 private void textBox1_Leave(object sender, EventArgs e)
 {
     ToolTip tip = new ToolTip();
     tip.IsBalloon = true;
     tip.ToolTipIcon = ToolTipIcon.Error;
     tip.ToolTipTitle = "Грешка!";
     if (textBox1.Text.Length == 0)
     {
         tip.Show("Моля въведете IP адрес или Hostname!", textBox1, 0, -65, 1000);
         textBox1.Focus();
         return;
     }
 }
예제 #46
0
        internal void NotificarEchoMessage(bool esReply, string ipOrigen, TimeSpan hora)
        {
            if (Contenedor.InvokeRequired)
            {
                Contenedor.BeginInvoke(new SetEcho(NotificarEchoMessage),
                                                            new object[] { esReply, ipOrigen, hora });

                return;
            }
            string mensaje =
"Hora: " + hora.ToString() + Environment.NewLine +
"IP Origen: " + ipOrigen;

            ToolTip toolTip = new ToolTip();
            toolTip.ToolTipIcon = ToolTipIcon.Info;
            if (!esReply)
            {
                toolTip.ToolTipTitle = "Echo Recibido";
                mensaje +=Environment.NewLine+ "Enviando Respuesta a: " + ipOrigen + "...";
            }
            else
            {
                toolTip.ToolTipTitle = "Echo Respondido";
            }
            toolTip.Show(mensaje, base.Contenedor.Window, DimensionMundo.Centro.X, DimensionMundo.Centro.Y, 5000);

        }
예제 #47
0
 private void button6_Click(object sender, EventArgs e)
 {
     ToolTip hint = new ToolTip();
     hint.IsBalloon = true;
     hint.ToolTipTitle = "TEST";
     hint.ToolTipIcon = ToolTipIcon.Error;
     hint.Show(string.Empty, button6, 0, 0);
     hint.Show("Please create a world.", button6, 0, 0);
 }