当前位置: 首页>>代码示例>>C#>>正文


C# Panel.Refresh方法代码示例

本文整理汇总了C#中System.Windows.Forms.Panel.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Refresh方法的具体用法?C# Panel.Refresh怎么用?C# Panel.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Panel的用法示例。


在下文中一共展示了Panel.Refresh方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: refreshInfo

 public void refreshInfo(DataGridView grid, Panel panel)
 {
     if (grid.CurrentRow != null)
     {
         Label text = new Label();
         text.AutoSize = true;
         text.Font = new Font("Courier New", text.Font.Size);
         Document d = (Document)grid.CurrentRow.DataBoundItem;
         text.Text = d.Afficher();
         panel.Controls.Add(text);
         panel.Refresh();
     }
 }
开发者ID:mlumeau,项目名称:Mediatheque,代码行数:13,代码来源:MainForm.cs

示例2: InitData

        /// <summary>
        /// 入出力データの初期化
        /// </summary>
        public void InitData(
            FemSolver solver,
            Panel CadPanel,
            Panel FValuePanel,
            Panel FValueLegendPanel, Label labelFreqValue,
            Chart SMatChart,
            Chart BetaChart,
            Chart EigenVecChart
            )
        {
            initInput();
            initOutput();

            // 一度だけの初期化処理
            initDataOnce(FValueLegendPanel, labelFreqValue);

            // ポストプロセッサに入力データをコピー
            // 入力データの取得
            solver.GetFemInputInfo(out Nodes, out Elements, out Medias, out Ports, out ForceNodes, out IncidentPortNo, out WaveguideWidth);
            // チャートの設定用に開始終了波長を取得
            FirstWaveLength = solver.FirstWaveLength;
            LastWaveLength = solver.LastWaveLength;
            CalcFreqCnt = solver.CalcFreqCnt;
            // 波のモード区分を取得
            WaveModeDv = solver.WaveModeDv;
            // 導波路構造区分を取得
            WGStructureDv = solver.WGStructureDv;
            // 導波路幅(E面解析用)
            WaveguideWidthForEPlane = solver.WaveguideWidthForEPlane;

            // 光導波路の最小、最大比誘電率を取得する
            setupOpticalWgEps();

            //if (isInputDataReady())
            // ポートが指定されていなくてもメッシュを表示できるように条件を変更
            if (Elements != null && Elements.Length > 0 && Nodes != null && Nodes.Length > 0 && Medias != null && Medias.Length > 0)
            {
                // 各要素に節点情報を補完する
                foreach (FemElement element in Elements)
                {
                    element.SetNodesFromAllNodes(Nodes);
                    element.LineColor = Color.Black;
                    element.BackColor = Medias[element.MediaIndex].BackColor;
                }
            }

            // メッシュ描画
            //using (Graphics g = CadPanel.CreateGraphics())
            //{
            //    DrawMesh(g, CadPanel);
            //}
            //CadPanel.Invalidate();

            if (!IsAutoCalc)
            {
                // チャート初期化
                ResetSMatChart(SMatChart);
                // 等高線図の凡例
                UpdateFValueLegend(FValueLegendPanel, labelFreqValue);
                // 等高線図
                //FValuePanel.Invalidate();
                FValuePanel.Refresh();
                // 固有値チャート初期化
                // この段階ではMaxModeの値が0なので、後に計算値ロード後一回だけ初期化する
                ResetEigenValueChart(BetaChart);
                // 固有ベクトル表示(空のデータで初期化)
                SetEigenVecToChart(EigenVecChart);
            }
        }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:72,代码来源:FemPostProLogic.cs

示例3: UpdateFValueLegend

 /// <summary>
 /// フィールド値凡例の更新
 /// </summary>
 /// <param name="legendPanel"></param>
 /// <param name="labelFreqValue"></param>
 public void UpdateFValueLegend(Panel legendPanel, Label labelFreqValue)
 {
     if (Math.Abs(WaveLength) < Constants.PrecisionLowerLimit)
     {
         labelFreqValue.Text = "---";
     }
     else
     {
         labelFreqValue.Text = string.Format("{0:F3}", GetNormalizedFrequency());
     }
     // BUGFIX [次の周波数][前の周波数]ボタンで周波数が遅れて表示される不具合を修正
     labelFreqValue.Refresh();
     legendPanel.Refresh();
 }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:19,代码来源:FemPostProLogic.cs

示例4: SetOutputToGui

        /// <summary>
        /// 出力をGUIへセットする
        /// </summary>
        /// <param name="addFlg">周波数特性グラフに読み込んだ周波数のデータを追加する?</param>
        /// <param name="isUpdateFValuePanel">等高線図を更新する?(データ読み込み時のアニメーションが遅いので更新しないようにするため導入)</param>
        public void SetOutputToGui(
            string FemOutputDatFilePath,
            Panel CadPanel,
            Panel FValuePanel,
            Panel FValueLegendPanel, Label labelFreqValue,
            Chart SMatChart,
            Chart BetaChart,
            Chart EigenVecChart,
            bool addFlg = true,
            bool isUpdateFValuePanel = true)
        {
            if (!isInputDataReady())
            {
                return;
            }
            if (!isOutputDataReady())
            {
                return;
            }
            if (IsAutoCalc)
            {
                ResetSMatChart(SMatChart);
                ResetEigenValueChart(BetaChart);
                /*
                // チャートのデータをクリア
                foreach (Series series in SMatChart.Series)
                {
                    series.Points.Clear();
                }
                foreach (Series series in BetaChart.Series)
                {
                    series.Points.Clear();
                }
                 */
                //foreach (Series series in EigenVecChart.Series)
                //{
                //    series.Points.Clear();
                //}
            }

            if (addFlg)
            {
                // Sマトリックス周波数特性グラフに計算した点を追加
                AddScatterMatrixToChart(SMatChart);

                // 固有値(伝搬定数)周波数特性グラフに計算した点を追加
                AddEigenValueToChart(BetaChart);
            }

            if (isUpdateFValuePanel)
            {
                // 等高線図の凡例
                UpdateFValueLegend(FValueLegendPanel, labelFreqValue);
                // 等高線図
                FValuePanel.Refresh();
            }
            // 固有ベクトル表示
            SetEigenVecToChart(EigenVecChart);

            if (IsAutoCalc)
            {
                // チャートの表示をポイント表示にする
                ShowChartDataLabel(SMatChart);
                ShowChartDataLabel(BetaChart);
            }
        }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:71,代码来源:FemPostProLogic.cs

示例5: InitOutputData

        /// <summary>
        /// 出力データだけ初期化する(自動計算モード用)
        /// </summary>
        /// <param name="CadPanel"></param>
        /// <param name="FValuePanel"></param>
        /// <param name="FValueLegendPanel"></param>
        /// <param name="labelFreqValue"></param>
        /// <param name="SMatChart"></param>
        /// <param name="BetaChart"></param>
        /// <param name="EigenVecChart"></param>
        public void InitOutputData(
            Panel CadPanel,
            Panel FValuePanel,
            Panel FValueLegendPanel, Label labelFreqValue,
            Chart SMatChart,
            Chart BetaChart,
            Chart EigenVecChart
            )
        {
            initOutput();

            // メッシュ描画
            //using (Graphics g = CadPanel.CreateGraphics())
            //{
            //    DrawMesh(g, CadPanel);
            //}
            //CadPanel.Invalidate();

            if (!IsAutoCalc)
            {
                // チャート初期化
                ResetSMatChart(SMatChart);
                // 等高線図の凡例
                UpdateFValueLegend(FValueLegendPanel, labelFreqValue);
                //FValuePanel.Invalidate();
                // 等高線図
                FValuePanel.Refresh();
                // 固有値チャート初期化
                // この段階ではMaxModeの値が0なので、後に計算値ロード後一回だけ初期化する
                ResetEigenValueChart(BetaChart);
                // 固有ベクトル表示(空のデータで初期化)
                SetEigenVecToChart(EigenVecChart);
            }
        }
开发者ID:ryujimiya,项目名称:HPlaneWGSimulator,代码行数:44,代码来源:FemPostProLogic.cs

示例6: playNote

        private void playNote(Panel keyPanel, string notePath)
        {
            Color keyColor = keyPanel.BackColor;
            keyPanel.BackColor = Color.Red;
            keyPanel.Refresh();

            using (SoundPlayer sp = new SoundPlayer(notePath))
            {
                sp.Play();
            }

            Thread.Sleep(50);

            keyPanel.BackColor = keyColor;
        }
开发者ID:steflongxu,项目名称:Piano,代码行数:15,代码来源:Piano.cs

示例7: RenderMessage

        /// <summary>
        /// Render the selected message's body and selected headers to the specified controls.
        /// </summary>
        /// <param name="message">The message to display.</param>
        /// <param name="headerTextBox">The textbox to populate with selected headers.</param>
        /// <param name="bodyWebBrowser">The web browser in which to render the body.</param>
        /// <param name="bodyWebBrowserPanel">The panel containing the web browser.</param>
        private void RenderMessage(MailMessage message, TextBox headerTextBox, WebBrowser bodyWebBrowser, Panel bodyWebBrowserPanel)
        {
            StringBuilder headersText = new StringBuilder(Constants.SMALLSBSIZE);

            // Output selected headers.
            headersText.Append("Date: " + message.Date.ToString() + "\r\n");
            headersText.Append("From: ");
            if (message.From != null)
                headersText.Append(message.From.DisplayName + " <" + message.From.Address + ">");
            else if (message.Sender != null)
                headersText.Append(message.Sender);
            headersText.Append("\r\n");
            if (message.To.Count > 0)
                headersText.Append("To: " + message.To + "\r\n");
            if (message.CC.Count > 0)
                headersText.Append("CC: " + message.CC + "\r\n");
            headersText.Append("Subject: " + message.Subject + "\r\n");
            if (message.PgpSigned)
                headersText.Append("PGP Signed: True\r\n");
            if (message.PgpEncryptedEnvelope)
                headersText.Append("PGP Encrypted: True\r\n");
            if (message.SmimeEncryptedEnvelope)
                headersText.Append("S/MIME Envelope Encrypted: True\r\n");
            if (message.SmimeTripleWrapped)
                headersText.Append("S/MIME Triple Wrapped: True\r\n");
            headersText.Append("Size: " + string.Format("{0:n0}", message.Size));
            if (message.RawFlags.Count > 0)
            {
                headersText.Append("\r\nFlags: ");
                bool firstFlag = true;
                foreach (string flag in message.RawFlags)
                {
                    if (!firstFlag)
                        headersText.Append("; ");
                    headersText.Append(flag);
                    firstFlag = false;
                }
            }
            if (message.Attachments.Count > 0)
            {
                headersText.Append("\r\nAttachments: ");
                for (int i = 0; i < message.Attachments.Count; i++)
                {
                    if (i > 0)
                        headersText.Append("; ");
                    headersText.Append(message.Attachments[i].Name + " (" + message.Attachments[i].MediaType + ")");
                }
            }

            headerTextBox.Text = headersText.ToString();

            if ((message.PgpEncryptedEnvelope && message.PgpSigned) || message.SmimeTripleWrapped)
                headerTextBox.BackColor = Color.LightGreen;
            else if (message.PgpEncryptedEnvelope || message.SmimeEncryptedEnvelope)
            {
                if (message.SmimeSigned)
                    headerTextBox.BackColor = Color.LightGreen;
                else
                    headerTextBox.BackColor = Color.GreenYellow;
            }
            else if (message.PgpSigned || message.SmimeSigned)
                headerTextBox.BackColor = Color.LightBlue;
            else
                headerTextBox.BackColor = Color.White;

            // If in a SPAM or JUNK folder, don't embed attachments;
            bool isJunkFolder = false;
            string mailboxName = mailbox.ToUpper();
            if (mailboxName.IndexOf("JUNK") > -1 || mailboxName.IndexOf("SPAM") > -1)
                isJunkFolder = true;

            string bodyHtml = Functions.RemoveScriptTags(message.Body);

            // If HTML, correct rendering of non-breaking spaces in the WebBrowser control.  Otherwise, cast to HTML.
            if (message.IsBodyHtml)
                bodyHtml = bodyHtml.Replace(char.ConvertFromUtf32(194).ToString(), "&nbsp;").Replace(char.ConvertFromUtf32(195).ToString(), "&nbsp;").Replace(char.ConvertFromUtf32(256).ToString(), "&nbsp;");
            else
                bodyHtml = Functions.ConvertPlainTextToHTML(bodyHtml);

            if (isJunkFolder)
                bodyHtml = bodyHtml.Replace("://", "://spam.");
            else
            {
                if (message.IsBodyHtml)
                    bodyHtml = Functions.EmbedAttachments(bodyHtml, message.Attachments);
                else
                    bodyHtml = Functions.EmbedAttachments(bodyHtml, null);
            }

            bodyWebBrowser.DocumentText = bodyHtml;
            bodyWebBrowserPanel.Refresh();
        }
开发者ID:ramazanaktolu,项目名称:OpaqueMail,代码行数:99,代码来源:Form1.cs

示例8: Move

 private static void Move(Panel pane, int x, int y)
 {
     pane.Left = x + pane.Left - _lastMouseX;
     pane.Top = y + pane.Top - _lastMouseY;
     currentArea = pane;
     pane.Refresh();
 }
开发者ID:Shoop123,项目名称:Notes-C-Sharp,代码行数:7,代码来源:ControlManager.cs

示例9: Transition

        public void Transition(ref Panel current, ref Panel next, EffectType type)
        {
            Bitmap currentBitmap = null;
            Bitmap nextBitmap = null;
            EpDefaultEffect effect = null;

            try
            {
                currentBitmap = GetPreviousCapturedImage(current, current.Name + ".bmp", false);    // 遷移前Panelをキャプチャ
                nextBitmap = null;

                string nextBitmapPath = next.Name + ".bmp";

                if (System.IO.File.Exists(nextBitmapPath))
                {
                    nextBitmap = new Bitmap(nextBitmapPath);
                }
                else
                {
                    nextBitmap = GetPreviousCapturedImage(next, nextBitmapPath, true);              // 初回のみ
                }

                this.Visible = true;                                // effectスタート
                current.Visible = false;

                if (type == EffectType.Random)
                {
                    type = (EffectType)random.Next(effectList.Count);
                }

                if (type == EffectType.None)
                {
                    effect = new EpDefaultEffect();
                }
                else
                {
                    effect = effectList[(int)type] as EpDefaultEffect;
                }

                effect.DrawEffectImage(currentBitmap, nextBitmap, this);

                next.Visible = true;
                next.Refresh();

                this.Visible = false;                               // effect終わり

                currentBitmap.Dispose();
                nextBitmap.Dispose();
            }
            catch (SystemException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
开发者ID:chanpi,项目名称:FormSample,代码行数:54,代码来源:EffectingPanel.cs

示例10: SetValue

        public void SetValue(Panel mPanel)
        {
            try
            {
                if((mPanel.Controls.Count > 0)&&(gvResults.Rows.Count > 0 ))
                {
                    DataSet ds = (DataSet)gvResults.DataSource;

                    DataTable dt = ds.Tables["dtResults"];
                    DataRow dr = dt.Rows.Find(mPanel.Tag.ToString());
                    if(dr != null)
                    {
                        string mVal = dr["colValue"].ToString();

                        mPanel.Controls.Add(lblScore(mVal, mPanel.Width, mPanel.Height));
                        mPanel.Refresh();

                        // parse out the label name to get the
                        // row and column it is in
                        int mCol = int.Parse(mPanel.Name.Substring(mPanel.Name.Length-1));
                        int mRow = int.Parse(mPanel.Name.Substring(1, mPanel.Name.Length - 3));
                        dr = this.dsScoreCard.Tables["dtScoreCard"].Rows[mRow];
                        dr[mCol] = mVal;

                        mCalcTotals(mCol);
                        // clean the SetValue and SetItem so
                        // no further values can be add until a new roll group is started
                        NewRollGroup();
                    }
                }
            }
             	catch(System.Exception ex)
             	{
             		EmailError.frmError eForm = new EmailError.frmError(ex.ToString(), mVersion);
             		eForm.ShowDialog();
             	}
        }
开发者ID:NightFox2870,项目名称:OOTechniekenYahtzeeCSharp,代码行数:37,代码来源:MainForm.cs

示例11: SetOutputToGui

        /// <summary>
        /// 出力をGUIへセットする
        /// </summary>
        /// <param name="addFlg">周波数特性グラフに読み込んだ周波数のデータを追加する?</param>
        public void SetOutputToGui(
            string FemOutputDatFilePath,
            Tao.Platform.Windows.SimpleOpenGlControl CadPanel,
            Panel FValuePanel,
            Panel FValueLegendPanel, Label labelFreqValue,
            Chart SMatChart,
            Chart BetaChart,
            Chart EigenVecChart,
            bool addFlg = true)
        {
            if (!isInputDataReady())
            {
                return;
            }
            if (!isOutputDataReady())
            {
                return;
            }

            if (addFlg)
            {
                // Sマトリックス周波数特性グラフに計算した点を追加
                AddScatterMatrixToChart(SMatChart);
                int firstFreqNo;
                int lastFreqNo;
                if (GetCalculatedFreqCnt(FemOutputDatFilePath, out firstFreqNo, out lastFreqNo) == 1)
                {
                    // 固有値チャート初期化(モード数が変わっているので再度初期化する)
                    ResetEigenValueChart(BetaChart);
                }
                // 固有値(伝搬定数)周波数特性グラフに計算した点を追加
                AddEigenValueToChart(BetaChart);
            }

            // 等高線図の凡例
            UpdateFValueLegend(FValueLegendPanel, labelFreqValue);
            // 等高線図
            //FValuePanel.Invalidate();
            FValuePanel.Refresh();
            // 固有ベクトル表示
            SetEigenVecToChart(EigenVecChart);
        }
开发者ID:liuqingjie06,项目名称:HPlaneWGSimulatorXDelFEM,代码行数:46,代码来源:FemPostProLogic.cs

示例12: AgregarEvento

        public void AgregarEvento(int iId, DateTime dFecha, string sTitulo, string sEvento)
        {
            var oEvento = Datos.GetEntity<ClienteEventoCalendario>(c => c.ClienteEventoCalendarioID == iId);
            var oAdeudo = Datos.GetEntity<ClientesCreditoView>(c => c.ClienteID == oEvento.ClienteID);

            var pnlEvento = new Panel();
            pnlEvento.Tag = iId;
            this.flpEventos.Controls.Add(pnlEvento);
            Util.CopiarPropiedades(this.pnlMuestra, pnlEvento, "Visible");

            foreach (Control oControl in this.pnlMuestra.Controls)
            {
                // Se crea el control nuevo
                Control oNuevo = null;
                if (oControl is DateTimePicker)
                    oNuevo = new DateTimePicker() { Name = "dtp" };
                else if (oControl is Button)
                    oNuevo = new Button();
                else if (oControl is Label)
                    oNuevo = new Label() { TextAlign = (oControl as Label).TextAlign };

                // Se copian las propiedades de la base/muestra
                Util.CopiarPropiedades(oControl, oNuevo, "Visible");
                oNuevo.Name = oControl.Name;

                // Se configuran los eventos para los controles especiales
                if (oControl == this.btnRevisado)
                {
                    oNuevo.Click += this.btnBien_Click;
                }
                else if (oControl == this.dtpFecha)
                {
                    var dtp = (oNuevo as DateTimePicker);
                    dtp.Format = DateTimePickerFormat.Custom;
                    dtp.CustomFormat = "dd/MM/yyy hh:mm tt";
                    dtp.Checked = true;
                    dtp.Value = oEvento.Fecha;
                    dtp.ValueChanged += dtpFecha_ValueChanged;
                }
                else if (oControl == this.lblCambio)
                {
                    oNuevo.Visible = false;
                }
                else if (oControl == this.lblCliente)
                {
                    oNuevo.Text = oAdeudo.Nombre;
                }
                else if (oControl == this.lblVencido || oControl == this.lblAdeudo)
                {
                    oNuevo.Text = (oControl == this.lblVencido ? oAdeudo.AdeudoVencido : oAdeudo.Adeudo).Valor().ToString(GlobalClass.FormatoMoneda);
                }
                else if (oControl == this.lblContacto)
                {
                    oNuevo.Text = oAdeudo.CobranzaContacto;
                }

                // Se agrega al panel
                pnlEvento.Controls.Add(oNuevo);
                pnlEvento.Refresh();
                pnlEvento.Update();
            }
        }
开发者ID:moisesiq,项目名称:aupaga,代码行数:62,代码来源:Eventos.cs

示例13: Arrange

 private void Arrange(Panel pnl)
 {
     Items.Sort(delegate(Group x, Group y)
     {
         if (x.Name == null && y.Name == null) return 0;
         else if (x.Name == null) return -1;
         else if (y.Name == null) return 1;
         else return x.Name.CompareTo(y.Name);
     });
     int yy = 0;
     pnl.AutoScrollOffset = new System.Drawing.Point(0, 0);
     pnl.AutoScrollPosition = new System.Drawing.Point(0, 0);
     foreach(Group g in Items)
     {
         g.rbtn.Top = yy;
         yy += g.rbtn.Height;
     }
     pnl.Refresh();
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:19,代码来源:GroupList.cs


注:本文中的System.Windows.Forms.Panel.Refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。