(十八)c#Winform自定义控件-提示框
官网
前提
入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。
GitHub:https://github.com/kwwwvagaa/NetWinformControl
码云:https://gitee.com/kwwwvagaa/net_winform_custom_control.git
如果觉得写的还行,请点个 star 支持一下吧
idkey=6e08741ef16fe53bf0314c1c9e336c4f626047943a8b76bac062361bab6b4f8d">
目录
https://www.cnblogs.com/bfyx/p/11364884.html
准备工作
这是一个提示消息的窗体,他继承自基类窗体FrmBase,如果你对FrmBase还不了解,请移步 (十七)c#Winform自定义控件-基类窗体 查看
提示消息窗体支持有确定取消按钮及单取消按钮,更多操作按钮暂没有增加
开始
添加一个Form命名为FrmDialog ,继承FrmBase
私有的构造函数
- private FrmDialog(
- string strMessage,
- string strTitle,
- bool blnShowCancel = false,
- bool blnShowClose = false,
- bool blnisEnterClose = true)
- {
- InitializeComponent();
- if (!string.IsNullOrWhiteSpace(strTitle))
- lblTitle.Text = strTitle;
- lblMsg.Text = strMessage;
- if (blnShowCancel)
- {
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- }
- else
- {
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- }
- btnClose.Visible = blnShowClose;
- blnEnterClose = blnisEnterClose;
- }
搭配一个静态的公共函数
- #region 显示一个模式信息框
- /// <summary>
- /// 功能描述:显示一个模式信息框
- /// 作 者:HZH
- /// 创建日期:2019-03-04 15:49:48
- /// 任务编号:POS
- /// </summary>
- /// <param name="owner">owner</param>
- /// <param name="strMessage">strMessage</param>
- /// <param name="strTitle">strTitle</param>
- /// <param name="blnShowCancel">blnShowCancel</param>
- /// <param name="isShowMaskDialog">isShowMaskDialog</param>
- /// <param name="blnShowClose">blnShowClose</param>
- /// <param name="isEnterClose">isEnterClose</param>
- /// <returns>返回值</returns>
- public static DialogResult ShowDialog(
- IWin32Window owner,
- string strMessage,
- string strTitle = "提示",
- bool blnShowCancel = false,
- bool isShowMaskDialog = true,
- bool blnShowClose = false,
- bool blnIsEnterClose = true)
- {
- DialogResult result = DialogResult.Cancel;
- if (owner == null || (owner is Control && (owner as Control).IsDisposed))
- {
- result = new FrmDialog(strMessage, strTitle, blnShowCancel, blnShowClose, blnIsEnterClose)
- {
- StartPosition = FormStartPosition.CenterScreen,
- IsShowMaskDialog = isShowMaskDialog,
- TopMost = true
- }.ShowDialog();
- }
- else
- {
- if (owner is Control)
- {
- owner = (owner as Control).FindForm();
- }
- result = new FrmDialog(strMessage, strTitle, blnShowCancel, blnShowClose, blnIsEnterClose)
- {
- StartPosition = (owner != null) ? FormStartPosition.CenterParent : FormStartPosition.CenterScreen,
- IsShowMaskDialog = isShowMaskDialog,
- TopMost = true
- }.ShowDialog(owner);
- }
- return result;
- }
- #endregion
一些小事件
- private void btnOK_BtnClick(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void btnCancel_BtnClick(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- private void btnClose_MouseDown(object sender, MouseEventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- protected override void DoEnter()
- {
- if (blnEnterClose)
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
代码就这么多,看下完整代码
- // 版权所有 黄正辉 交流群:568015492 QQ:623128629
- // 文件名称:FrmDialog.cs
- // 创建日期:2019-08-15 16:04:36
- // 功能描述:FrmDialog
- // 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace HZH_Controls.Forms
- {
- public partial class FrmDialog : FrmBase
- {
- bool blnEnterClose = true;
- private FrmDialog(
- string strMessage,
- string strTitle,
- bool blnShowCancel = false,
- bool blnShowClose = false,
- bool blnisEnterClose = true)
- {
- InitializeComponent();
- if (!string.IsNullOrWhiteSpace(strTitle))
- lblTitle.Text = strTitle;
- lblMsg.Text = strMessage;
- if (blnShowCancel)
- {
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- }
- else
- {
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- this.tableLayoutPanel1.ColumnStyles[].Width = ;
- }
- //btnCancel.Visible = blnShowCancel;
- //ucSplitLine_V1.Visible = blnShowCancel;
- btnClose.Visible = blnShowClose;
- blnEnterClose = blnisEnterClose;
- //if (blnShowCancel)
- //{
- // btnOK.BtnForeColor = Color.FromArgb(255, 85, 51);
- //}
- }
- #region 显示一个模式信息框
- /// <summary>
- /// 功能描述:显示一个模式信息框
- /// 作 者:HZH
- /// 创建日期:2019-03-04 15:49:48
- /// 任务编号:POS
- /// </summary>
- /// <param name="owner">owner</param>
- /// <param name="strMessage">strMessage</param>
- /// <param name="strTitle">strTitle</param>
- /// <param name="blnShowCancel">blnShowCancel</param>
- /// <param name="isShowMaskDialog">isShowMaskDialog</param>
- /// <param name="blnShowClose">blnShowClose</param>
- /// <param name="isEnterClose">isEnterClose</param>
- /// <returns>返回值</returns>
- public static DialogResult ShowDialog(
- IWin32Window owner,
- string strMessage,
- string strTitle = "提示",
- bool blnShowCancel = false,
- bool isShowMaskDialog = true,
- bool blnShowClose = false,
- bool blnIsEnterClose = true)
- {
- DialogResult result = DialogResult.Cancel;
- if (owner == null || (owner is Control && (owner as Control).IsDisposed))
- {
- result = new FrmDialog(strMessage, strTitle, blnShowCancel, blnShowClose, blnIsEnterClose)
- {
- StartPosition = FormStartPosition.CenterScreen,
- IsShowMaskDialog = isShowMaskDialog,
- TopMost = true
- }.ShowDialog();
- }
- else
- {
- if (owner is Control)
- {
- owner = (owner as Control).FindForm();
- }
- result = new FrmDialog(strMessage, strTitle, blnShowCancel, blnShowClose, blnIsEnterClose)
- {
- StartPosition = (owner != null) ? FormStartPosition.CenterParent : FormStartPosition.CenterScreen,
- IsShowMaskDialog = isShowMaskDialog,
- TopMost = true
- }.ShowDialog(owner);
- }
- return result;
- }
- #endregion
- private void btnOK_BtnClick(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void btnCancel_BtnClick(object sender, EventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- private void btnClose_MouseDown(object sender, MouseEventArgs e)
- {
- this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- }
- protected override void DoEnter()
- {
- if (blnEnterClose)
- this.DialogResult = System.Windows.Forms.DialogResult.OK;
- }
- private void FrmDialog_VisibleChanged(object sender, EventArgs e)
- {
- }
- }
- }
- namespace HZH_Controls.Forms
- {
- partial class FrmDialog
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDialog));
- this.btnClose = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.btnCancel = new HZH_Controls.Controls.UCBtnExt();
- this.ucSplitLine_V1 = new HZH_Controls.Controls.UCSplitLine_V();
- this.btnOK = new HZH_Controls.Controls.UCBtnExt();
- this.lblMsg = new System.Windows.Forms.Label();
- this.lblTitle = new System.Windows.Forms.Label();
- this.ucSplitLine_H1 = new HZH_Controls.Controls.UCSplitLine_H();
- this.ucSplitLine_H2 = new HZH_Controls.Controls.UCSplitLine_H();
- this.panel1.SuspendLayout();
- this.tableLayoutPanel1.SuspendLayout();
- this.SuspendLayout();
- //
- // btnClose
- //
- this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnClose.BackgroundImage = global::HZH_Controls.Properties.Resources.dialog_close;
- this.btnClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
- this.btnClose.Location = new System.Drawing.Point(, );
- this.btnClose.Name = "btnClose";
- this.btnClose.Size = new System.Drawing.Size(, );
- this.btnClose.TabIndex = ;
- this.btnClose.MouseDown += new System.Windows.Forms.MouseEventHandler(this.btnClose_MouseDown);
- //
- // panel1
- //
- this.panel1.Controls.Add(this.tableLayoutPanel1);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.panel1.Location = new System.Drawing.Point(, );
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(, );
- this.panel1.TabIndex = ;
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.ColumnCount = ;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 1F));
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tableLayoutPanel1.Controls.Add(this.btnCancel, , );
- this.tableLayoutPanel1.Controls.Add(this.ucSplitLine_V1, , );
- this.tableLayoutPanel1.Controls.Add(this.btnOK, , );
- this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tableLayoutPanel1.Location = new System.Drawing.Point(, );
- this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding();
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = ;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.tableLayoutPanel1.Size = new System.Drawing.Size(, );
- this.tableLayoutPanel1.TabIndex = ;
- //
- // btnCancel
- //
- this.btnCancel.BackColor = System.Drawing.Color.Transparent;
- this.btnCancel.BtnBackColor = System.Drawing.Color.Transparent;
- this.btnCancel.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)()));
- this.btnCancel.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.btnCancel.BtnText = "取消";
- this.btnCancel.ConerRadius = ;
- this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btnCancel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.btnCancel.FillColor = System.Drawing.Color.White;
- this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
- this.btnCancel.IsRadius = false;
- this.btnCancel.IsShowRect = false;
- this.btnCancel.IsShowTips = false;
- this.btnCancel.Location = new System.Drawing.Point(, );
- this.btnCancel.Margin = new System.Windows.Forms.Padding();
- this.btnCancel.Name = "btnCancel";
- this.btnCancel.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.btnCancel.RectWidth = ;
- this.btnCancel.Size = new System.Drawing.Size(, );
- this.btnCancel.TabIndex = ;
- this.btnCancel.TabStop = false;
- this.btnCancel.TipsText = "";
- this.btnCancel.BtnClick += new System.EventHandler(this.btnCancel_BtnClick);
- //
- // ucSplitLine_V1
- //
- this.ucSplitLine_V1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.ucSplitLine_V1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.ucSplitLine_V1.Location = new System.Drawing.Point(, );
- this.ucSplitLine_V1.Margin = new System.Windows.Forms.Padding(, , , );
- this.ucSplitLine_V1.Name = "ucSplitLine_V1";
- this.ucSplitLine_V1.Size = new System.Drawing.Size(, );
- this.ucSplitLine_V1.TabIndex = ;
- this.ucSplitLine_V1.TabStop = false;
- //
- // btnOK
- //
- this.btnOK.BackColor = System.Drawing.Color.Transparent;
- this.btnOK.BtnBackColor = System.Drawing.Color.Transparent;
- this.btnOK.BtnFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)()));
- this.btnOK.BtnForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.btnOK.BtnText = "确定";
- this.btnOK.ConerRadius = ;
- this.btnOK.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btnOK.Dock = System.Windows.Forms.DockStyle.Fill;
- this.btnOK.FillColor = System.Drawing.Color.White;
- this.btnOK.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
- this.btnOK.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.btnOK.IsRadius = false;
- this.btnOK.IsShowRect = false;
- this.btnOK.IsShowTips = false;
- this.btnOK.Location = new System.Drawing.Point(, );
- this.btnOK.Margin = new System.Windows.Forms.Padding();
- this.btnOK.Name = "btnOK";
- this.btnOK.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.btnOK.RectWidth = ;
- this.btnOK.Size = new System.Drawing.Size(, );
- this.btnOK.TabIndex = ;
- this.btnOK.TabStop = false;
- this.btnOK.TipsText = "";
- this.btnOK.BtnClick += new System.EventHandler(this.btnOK_BtnClick);
- //
- // lblMsg
- //
- this.lblMsg.BackColor = System.Drawing.Color.White;
- this.lblMsg.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lblMsg.Font = new System.Drawing.Font("微软雅黑", 12F);
- this.lblMsg.Location = new System.Drawing.Point(, );
- this.lblMsg.Name = "lblMsg";
- this.lblMsg.Padding = new System.Windows.Forms.Padding();
- this.lblMsg.Size = new System.Drawing.Size(, );
- this.lblMsg.TabIndex = ;
- this.lblMsg.Text = "这是一个提示信息。";
- //
- // lblTitle
- //
- this.lblTitle.BackColor = System.Drawing.Color.Transparent;
- this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
- this.lblTitle.Font = new System.Drawing.Font("微软雅黑", 17F);
- this.lblTitle.Location = new System.Drawing.Point(, );
- this.lblTitle.Name = "lblTitle";
- this.lblTitle.Size = new System.Drawing.Size(, );
- this.lblTitle.TabIndex = ;
- this.lblTitle.Text = "提示";
- this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // ucSplitLine_H1
- //
- this.ucSplitLine_H1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.ucSplitLine_H1.Dock = System.Windows.Forms.DockStyle.Top;
- this.ucSplitLine_H1.Location = new System.Drawing.Point(, );
- this.ucSplitLine_H1.Name = "ucSplitLine_H1";
- this.ucSplitLine_H1.Size = new System.Drawing.Size(, );
- this.ucSplitLine_H1.TabIndex = ;
- this.ucSplitLine_H1.TabStop = false;
- //
- // ucSplitLine_H2
- //
- this.ucSplitLine_H2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
- this.ucSplitLine_H2.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.ucSplitLine_H2.Location = new System.Drawing.Point(, );
- this.ucSplitLine_H2.Name = "ucSplitLine_H2";
- this.ucSplitLine_H2.Size = new System.Drawing.Size(, );
- this.ucSplitLine_H2.TabIndex = ;
- this.ucSplitLine_H2.TabStop = false;
- //
- // FrmDialog
- //
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
- this.BackColor = System.Drawing.Color.White;
- this.ClientSize = new System.Drawing.Size(, );
- this.Controls.Add(this.ucSplitLine_H2);
- this.Controls.Add(this.ucSplitLine_H1);
- this.Controls.Add(this.btnClose);
- this.Controls.Add(this.panel1);
- this.Controls.Add(this.lblMsg);
- this.Controls.Add(this.lblTitle);
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.IsFullSize = false;
- this.IsShowRegion = true;
- this.Name = "FrmDialog";
- this.Redraw = true;
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.Text = "FrmDialoag";
- this.VisibleChanged += new System.EventHandler(this.FrmDialog_VisibleChanged);
- this.panel1.ResumeLayout(false);
- this.tableLayoutPanel1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion
- private System.Windows.Forms.Label lblTitle;
- private Controls.UCBtnExt btnOK;
- private Controls.UCBtnExt btnCancel;
- private System.Windows.Forms.Label lblMsg;
- private System.Windows.Forms.Panel panel1;
- private Controls.UCSplitLine_V ucSplitLine_V1;
- private System.Windows.Forms.Panel btnClose;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- private Controls.UCSplitLine_H ucSplitLine_H1;
- private Controls.UCSplitLine_H ucSplitLine_H2;
- }
- }
用处及效果
用处:一般用在一个需要用户确定的提示上
效果:
调用示例
- if (FrmDialog.ShowDialog(this, "是否再显示一个没有取消按钮的提示框?", "模式窗体测试", true) == System.Windows.Forms.DialogResult.OK)
- {
- FrmDialog.ShowDialog(this, "这是一个没有取消按钮的提示框", "模式窗体测试");
- }
最后的话
如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星 星吧
(十八)c#Winform自定义控件-提示框的更多相关文章
- (三十)c#Winform自定义控件-文本框(三)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (十六)c#Winform自定义控件-文本框哪里去了?-HZHControls
官网 http://www.hzhcontrols.com 前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kww ...
- (八十二)c#Winform自定义控件-穿梭框
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- (三十一)c#Winform自定义控件-文本框(四)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (五十)c#Winform自定义控件-滑块
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- (二十)c#Winform自定义控件-有后退的窗体
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- (二十八)c#Winform自定义控件-文本框(一)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- .net开发笔记(十八) winform中的等待框
winform中很多任务是需要在后台线程(或类似)中完成的,也就是说,经常容易涉及到UI界面与后台工作线程之间的交互.比如UI界面控制后台工作的执行(启动.暂停.停止等),后台工作进度在UI界面上的显 ...
- (二十九)c#Winform自定义控件-文本框(二)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
随机推荐
- SpringBoot项目构建成jar运行后,如何正确读取resource下的文件
SpringBoot项目构建成jar运行后,如何正确读取resource下的文件 不管你使用的是SpringBoot 1.x还是SpringBoot2.x,在开Dev环境中使用eclipse.IEAD ...
- JavaScript作用域及预编译
几乎所有的编程语言都可以存储,访问,修改变量,那在JavaScript中这些变量放在那里?程序如何找到他们? js被归类于解释执行语言,但事实上他也是一门编译语言,因为他也要编译,但于传统的编译语言不 ...
- spark 源码分析之十八 -- Spark存储体系剖析
本篇文章主要剖析BlockManager相关的类以及总结Spark底层存储体系. 总述 先看 BlockManager相关类之间的关系如下: 我们从NettyRpcEnv 开始,做一下简单说明. Ne ...
- Python -----函数(基础部分)
函数: 1.定义: 函数是对功能的封装 2.语法: def 函数名 函数体 函数名 函数名的命名规则和变量一样 3.函数的返回值: return,函数执行完毕,不会执行后面的 1.如果函数中不写ret ...
- ajax同步与异步 理解
例如,小明去餐馆排队点餐,前台服务员将小明的菜单告诉厨师进行制作,此时小明后面排队的人就一直等着,直到厨师制作完成,把饭菜送到小明手里后离开,后面的人才能继续点餐:这就是同步处理 但是,如果前台服务员 ...
- 《VR入门系列教程》之11---基本几何-材质-光照
网格.多边形.顶点 绘制3D图形有许多方法,用的最多的是用网格绘制.一个网格由一个或多个多边形组成,这些多边形的顶点都是三维空间中的点,它们具有x.y.z三个坐标值.网格中通常采用三角形和四边 ...
- storm入门demo
一.storm入门demo的介绍 storm的入门helloworld有2种方式,一种是本地的,另一种是远程. 本地实现: 本地写好demo之后,不用搭建storm集群,下载storm的相关jar包即 ...
- Hadoop自学系列集(四) ---- Hadoop集群
久等了,近期公司比较忙,学习的时间都没有啊,到今日才有时间呢!!!好了,下面就跟着笔者开始配置Hadoop集群吧. hosts文件和SSH免密码登录配置好了之后,现在进入Hadoop安装目录,修改一些 ...
- java基础知识总结,绝对经典
写代码: 1,明确需求.我要做什么? 2,分析思路.我要怎么做?1,2,3. 3,确定步骤.每一个思路部分用到哪些语句,方法,和对象. 4,代码实现.用具体的java语言代码把思路体现出来. 学习新技 ...
- 关于程序null值的见解
今天遇到了一个问题,查询一条数据,返回用list接,发现少了2个值(ssh框架).执行SQL少的这两个字段的值为null.上图说明一下: 可以看到第一次查询没有角标38.39的值. 是同一条SQL,第 ...