官网

http://www.hzhcontrols.com

前提

入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章。

GitHub:https://github.com/kwwwvagaa/NetWinformControl

码云:https://gitee.com/kwwwvagaa/net_winform_custom_control.git

如果觉得写的还行,请点个 star 支持一下吧

欢迎前来交流探讨: 企鹅群568015492 

idkey=6e08741ef16fe53bf0314c1c9e336c4f626047943a8b76bac062361bab6b4f8d">

目录

https://www.cnblogs.com/bfyx/p/11364884.html

准备工作

此控件用到了停靠窗体和日期控件的一个面板,以及基类控件,如果你还对此不了解,请移步

(一)c#Winform自定义控件-基类控件

(十九)c#Winform自定义控件-停靠窗体

(三十三)c#Winform自定义控件-日期控件

开始

添加一个用户控件,命名UCComboBox,继承自UCControlBase

属性

 Color _ForeColor = Color.FromArgb(, , );
[Description("文字颜色"), Category("自定义")]
public override Color ForeColor
{
get
{
return _ForeColor;
}
set
{
_ForeColor = value;
lblInput.ForeColor = value;
txtInput.ForeColor = value;
}
} public event EventHandler SelectedChangedEvent;
public event EventHandler TextChangedEvent; private ComboBoxStyle _BoxStyle = ComboBoxStyle.DropDown; [Description("控件样式"), Category("自定义")]
public ComboBoxStyle BoxStyle
{
get { return _BoxStyle; }
set
{
_BoxStyle = value;
if (value == ComboBoxStyle.DropDownList)
{
lblInput.Visible = true;
txtInput.Visible = false;
}
else
{
lblInput.Visible = false;
txtInput.Visible = true;
} if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
}
} private Font _Font = new Font("微软雅黑", );
[Description("字体"), Category("自定义")]
public new Font Font
{
get { return _Font; }
set
{
_Font = value;
lblInput.Font = value;
txtInput.Font = value;
txtInput.PromptFont = value;
this.txtInput.Location = new Point(this.txtInput.Location.X, (this.Height - txtInput.Height) / );
this.lblInput.Location = new Point(this.lblInput.Location.X, (this.Height - lblInput.Height) / );
}
} [Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color FillColor
{
get;
set;
} [Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color RectColor
{
get;
set;
} private string _TextValue; public string TextValue
{
get { return _TextValue; }
set
{
_TextValue = value;
if (lblInput.Text != value)
lblInput.Text = value;
if (txtInput.Text != value)
txtInput.Text = value;
}
} private List<KeyValuePair<string, string>> _source = null; public List<KeyValuePair<string, string>> Source
{
get { return _source; }
set
{
_source = value;
_selectedIndex = -;
_selectedValue = "";
_selectedItem = new KeyValuePair<string, string>();
_selectedText = "";
lblInput.Text = "";
txtInput.Text = "";
}
} private KeyValuePair<string, string> _selectedItem = new KeyValuePair<string, string>(); private int _selectedIndex = -; public int SelectedIndex
{
get
{
return _selectedIndex;
}
set
{
if (value < || _source == null || _source.Count <= || value >= _source.Count)
{
_selectedIndex = -;
_selectedValue = "";
_selectedItem = new KeyValuePair<string, string>();
SelectedText = "";
}
else
{
_selectedIndex = value;
_selectedItem = _source[value];
_selectedValue = _source[value].Key;
SelectedText = _source[value].Value;
}
}
} private string _selectedValue = ""; public string SelectedValue
{
get
{
return _selectedValue;
}
set
{
if (_source == null || _source.Count <= )
{
SelectedText = "";
_selectedValue = "";
_selectedIndex = -;
_selectedItem = new KeyValuePair<string, string>();
}
else
{
for (int i = ; i < _source.Count; i++)
{
if (_source[i].Key == value)
{
_selectedValue = value;
_selectedIndex = i;
_selectedItem = _source[i];
SelectedText = _source[i].Value;
return;
}
}
_selectedValue = "";
_selectedIndex = -;
_selectedItem = new KeyValuePair<string, string>();
SelectedText = "";
}
}
} private string _selectedText = ""; public string SelectedText
{
get { return _selectedText; }
private set
{
_selectedText = value;
lblInput.Text = _selectedText;
txtInput.Text = _selectedText;
if (SelectedChangedEvent != null)
{
SelectedChangedEvent(this, null);
}
}
} private int _ItemWidth = ; public int ItemWidth
{
get { return _ItemWidth; }
set { _ItemWidth = value; }
} private int _dropPanelHeight = -; public int DropPanelHeight
{
get { return _dropPanelHeight; }
set { _dropPanelHeight = value; }
}
[Obsolete("不再可用的属性,如需要改变背景色,请使用BackColorExt")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor = Color.Transparent;
}
} private Color _BackColor = Color.FromArgb(, , ); public Color BackColorExt
{
get
{
return _BackColor;
}
set
{
if (value == Color.Transparent)
return;
_BackColor = value;
lblInput.BackColor = value; if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = value;
base.FillColor = value;
base.RectColor = value;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
}
}

构造函数初始化处理

  public UCComboBox()
{
InitializeComponent();
lblInput.BackColor = _BackColor;
if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
base.BackColor = Color.Transparent;
}

一些事件处理

 private void UCComboBox_SizeChanged(object sender, EventArgs e)
{
this.txtInput.Location = new Point(this.txtInput.Location.X, (this.Height - txtInput.Height) / );
this.lblInput.Location = new Point(this.lblInput.Location.X, (this.Height - lblInput.Height) / );
} private void txtInput_TextChanged(object sender, EventArgs e)
{
TextValue = txtInput.Text;
if (TextChangedEvent != null)
{
TextChangedEvent(this, null);
}
} private void click_MouseDown(object sender, MouseEventArgs e)
{
if (_frmAnchor == null || _frmAnchor.IsDisposed || _frmAnchor.Visible == false)
{ if (this.Source != null && this.Source.Count > )
{
int intRow = ;
int intCom = ;
var p = this.PointToScreen(this.Location);
while (true)
{
int intScreenHeight = Screen.PrimaryScreen.Bounds.Height;
if ((p.Y + this.Height + this.Source.Count / intCom * < intScreenHeight || p.Y - this.Source.Count / intCom * > )
&& (_dropPanelHeight <= ? true : (this.Source.Count / intCom * <= _dropPanelHeight)))
{
intRow = this.Source.Count / intCom + (this.Source.Count % intCom != ? : );
break;
}
intCom++;
}
UCTimePanel ucTime = new UCTimePanel();
ucTime.IsShowBorder = true;
int intWidth = this.Width / intCom;
if (intWidth < _ItemWidth)
intWidth = _ItemWidth;
Size size = new Size(intCom * intWidth, intRow * );
ucTime.Size = size;
ucTime.FirstEvent = true;
ucTime.SelectSourceEvent += ucTime_SelectSourceEvent;
ucTime.Row = intRow;
ucTime.Column = intCom;
List<KeyValuePair<string, string>> lst = new List<KeyValuePair<string, string>>();
foreach (var item in this.Source)
{
lst.Add(new KeyValuePair<string, string>(item.Key, item.Value));
}
ucTime.Source = lst; ucTime.SetSelect(_selectedValue); _frmAnchor = new Forms.FrmAnchor(this, ucTime);
_frmAnchor.Load += (a, b) => { (a as Form).Size = size; }; _frmAnchor.Show(this.FindForm()); }
}
else
{
_frmAnchor.Close();
}
} Forms.FrmAnchor _frmAnchor;
void ucTime_SelectSourceEvent(object sender, EventArgs e)
{
if (_frmAnchor != null && !_frmAnchor.IsDisposed && _frmAnchor.Visible)
{
SelectedValue = sender.ToString();
_frmAnchor.Close();
}
} private void UCComboBox_Load(object sender, EventArgs e)
{
if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
} //if (this.Parent != null && BackColor == Color.Transparent)
}
}
}

完整代码如下

 // 版权所有  黄正辉  交流群:568015492   QQ:623128629
// 文件名称:UCComboBox.cs
// 创建日期:2019-08-15 15:58:51
// 功能描述:ComboBox
// 项目地址:https://gitee.com/kwwwvagaa/net_winform_custom_control
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace HZH_Controls.Controls
{
[DefaultEvent("SelectedChangedEvent")]
public partial class UCComboBox : UCControlBase
{
Color _ForeColor = Color.FromArgb(, , );
[Description("文字颜色"), Category("自定义")]
public override Color ForeColor
{
get
{
return _ForeColor;
}
set
{
_ForeColor = value;
lblInput.ForeColor = value;
txtInput.ForeColor = value;
}
} public event EventHandler SelectedChangedEvent;
public event EventHandler TextChangedEvent; private ComboBoxStyle _BoxStyle = ComboBoxStyle.DropDown; [Description("控件样式"), Category("自定义")]
public ComboBoxStyle BoxStyle
{
get { return _BoxStyle; }
set
{
_BoxStyle = value;
if (value == ComboBoxStyle.DropDownList)
{
lblInput.Visible = true;
txtInput.Visible = false;
}
else
{
lblInput.Visible = false;
txtInput.Visible = true;
} if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
}
} private Font _Font = new Font("微软雅黑", );
[Description("字体"), Category("自定义")]
public new Font Font
{
get { return _Font; }
set
{
_Font = value;
lblInput.Font = value;
txtInput.Font = value;
txtInput.PromptFont = value;
this.txtInput.Location = new Point(this.txtInput.Location.X, (this.Height - txtInput.Height) / );
this.lblInput.Location = new Point(this.lblInput.Location.X, (this.Height - lblInput.Height) / );
}
} [Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color FillColor
{
get;
set;
} [Obsolete("不再可用的属性")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color RectColor
{
get;
set;
} private string _TextValue; public string TextValue
{
get { return _TextValue; }
set
{
_TextValue = value;
if (lblInput.Text != value)
lblInput.Text = value;
if (txtInput.Text != value)
txtInput.Text = value;
}
} private List<KeyValuePair<string, string>> _source = null; public List<KeyValuePair<string, string>> Source
{
get { return _source; }
set
{
_source = value;
_selectedIndex = -;
_selectedValue = "";
_selectedItem = new KeyValuePair<string, string>();
_selectedText = "";
lblInput.Text = "";
txtInput.Text = "";
}
} private KeyValuePair<string, string> _selectedItem = new KeyValuePair<string, string>(); private int _selectedIndex = -; public int SelectedIndex
{
get
{
return _selectedIndex;
}
set
{
if (value < || _source == null || _source.Count <= || value >= _source.Count)
{
_selectedIndex = -;
_selectedValue = "";
_selectedItem = new KeyValuePair<string, string>();
SelectedText = "";
}
else
{
_selectedIndex = value;
_selectedItem = _source[value];
_selectedValue = _source[value].Key;
SelectedText = _source[value].Value;
}
}
} private string _selectedValue = ""; public string SelectedValue
{
get
{
return _selectedValue;
}
set
{
if (_source == null || _source.Count <= )
{
SelectedText = "";
_selectedValue = "";
_selectedIndex = -;
_selectedItem = new KeyValuePair<string, string>();
}
else
{
for (int i = ; i < _source.Count; i++)
{
if (_source[i].Key == value)
{
_selectedValue = value;
_selectedIndex = i;
_selectedItem = _source[i];
SelectedText = _source[i].Value;
return;
}
}
_selectedValue = "";
_selectedIndex = -;
_selectedItem = new KeyValuePair<string, string>();
SelectedText = "";
}
}
} private string _selectedText = ""; public string SelectedText
{
get { return _selectedText; }
private set
{
_selectedText = value;
lblInput.Text = _selectedText;
txtInput.Text = _selectedText;
if (SelectedChangedEvent != null)
{
SelectedChangedEvent(this, null);
}
}
} private int _ItemWidth = ; public int ItemWidth
{
get { return _ItemWidth; }
set { _ItemWidth = value; }
} private int _dropPanelHeight = -; public int DropPanelHeight
{
get { return _dropPanelHeight; }
set { _dropPanelHeight = value; }
}
[Obsolete("不再可用的属性,如需要改变背景色,请使用BackColorExt")]
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
private new Color BackColor
{
get
{
return base.BackColor;
}
set
{
base.BackColor = Color.Transparent;
}
} private Color _BackColor = Color.FromArgb(, , ); public Color BackColorExt
{
get
{
return _BackColor;
}
set
{
if (value == Color.Transparent)
return;
_BackColor = value;
lblInput.BackColor = value; if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = value;
base.FillColor = value;
base.RectColor = value;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
}
} public UCComboBox()
{
InitializeComponent();
lblInput.BackColor = _BackColor;
if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
base.BackColor = Color.Transparent;
} private void UCComboBox_SizeChanged(object sender, EventArgs e)
{
this.txtInput.Location = new Point(this.txtInput.Location.X, (this.Height - txtInput.Height) / );
this.lblInput.Location = new Point(this.lblInput.Location.X, (this.Height - lblInput.Height) / );
} private void txtInput_TextChanged(object sender, EventArgs e)
{
TextValue = txtInput.Text;
if (TextChangedEvent != null)
{
TextChangedEvent(this, null);
}
} private void click_MouseDown(object sender, MouseEventArgs e)
{
if (_frmAnchor == null || _frmAnchor.IsDisposed || _frmAnchor.Visible == false)
{ if (this.Source != null && this.Source.Count > )
{
int intRow = ;
int intCom = ;
var p = this.PointToScreen(this.Location);
while (true)
{
int intScreenHeight = Screen.PrimaryScreen.Bounds.Height;
if ((p.Y + this.Height + this.Source.Count / intCom * < intScreenHeight || p.Y - this.Source.Count / intCom * > )
&& (_dropPanelHeight <= ? true : (this.Source.Count / intCom * <= _dropPanelHeight)))
{
intRow = this.Source.Count / intCom + (this.Source.Count % intCom != ? : );
break;
}
intCom++;
}
UCTimePanel ucTime = new UCTimePanel();
ucTime.IsShowBorder = true;
int intWidth = this.Width / intCom;
if (intWidth < _ItemWidth)
intWidth = _ItemWidth;
Size size = new Size(intCom * intWidth, intRow * );
ucTime.Size = size;
ucTime.FirstEvent = true;
ucTime.SelectSourceEvent += ucTime_SelectSourceEvent;
ucTime.Row = intRow;
ucTime.Column = intCom;
List<KeyValuePair<string, string>> lst = new List<KeyValuePair<string, string>>();
foreach (var item in this.Source)
{
lst.Add(new KeyValuePair<string, string>(item.Key, item.Value));
}
ucTime.Source = lst; ucTime.SetSelect(_selectedValue); _frmAnchor = new Forms.FrmAnchor(this, ucTime);
_frmAnchor.Load += (a, b) => { (a as Form).Size = size; }; _frmAnchor.Show(this.FindForm()); }
}
else
{
_frmAnchor.Close();
}
} Forms.FrmAnchor _frmAnchor;
void ucTime_SelectSourceEvent(object sender, EventArgs e)
{
if (_frmAnchor != null && !_frmAnchor.IsDisposed && _frmAnchor.Visible)
{
SelectedValue = sender.ToString();
_frmAnchor.Close();
}
} private void UCComboBox_Load(object sender, EventArgs e)
{
if (this._BoxStyle == ComboBoxStyle.DropDownList)
{
txtInput.BackColor = _BackColor;
base.FillColor = _BackColor;
base.RectColor = _BackColor;
}
else
{
txtInput.BackColor = Color.White;
base.FillColor = Color.White;
base.RectColor = Color.FromArgb(, , );
}
}
}
}
 namespace HZH_Controls.Controls
{
partial class UCComboBox
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region 组件设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.txtInput = new HZH_Controls.Controls.TextBoxEx();
this.lblInput = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Transparent;
this.panel1.BackgroundImage = global::HZH_Controls.Properties.Resources.ComboBox;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
this.panel1.Location = new System.Drawing.Point(, );
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(, );
this.panel1.TabIndex = ;
this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.click_MouseDown);
//
// txtInput
//
this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.txtInput.BackColor = System.Drawing.Color.White;
this.txtInput.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtInput.DecLength = ;
this.txtInput.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.txtInput.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
this.txtInput.InputType = TextInputType.NotControl;
this.txtInput.Location = new System.Drawing.Point(, );
this.txtInput.Margin = new System.Windows.Forms.Padding(, , , );
this.txtInput.MaxValue = new decimal(new int[] {
,
,
,
});
this.txtInput.MinValue = new decimal(new int[] {
,
,
,
-});
this.txtInput.MyRectangle = new System.Drawing.Rectangle(, , , );
this.txtInput.Name = "txtInput";
this.txtInput.OldText = null;
this.txtInput.PromptColor = System.Drawing.Color.Silver;
this.txtInput.PromptFont = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.txtInput.PromptText = "";
this.txtInput.RegexPattern = "";
this.txtInput.Size = new System.Drawing.Size(, );
this.txtInput.TabIndex = ;
this.txtInput.TextChanged += new System.EventHandler(this.txtInput_TextChanged);
//
// lblInput
//
this.lblInput.AutoSize = true;
this.lblInput.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)()))), ((int)(((byte)()))), ((int)(((byte)()))));
this.lblInput.Location = new System.Drawing.Point(, );
this.lblInput.Name = "lblInput";
this.lblInput.Size = new System.Drawing.Size(, );
this.lblInput.TabIndex = ;
this.lblInput.Visible = false;
this.lblInput.MouseDown += new System.Windows.Forms.MouseEventHandler(this.click_MouseDown);
//
// UCComboBox
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = ;
this.Controls.Add(this.panel1);
this.Controls.Add(this.txtInput);
this.Controls.Add(this.lblInput);
this.FillColor = System.Drawing.Color.Gainsboro;
this.IsShowRect = true;
this.Name = "UCComboBox";
this.Size = new System.Drawing.Size(, );
this.Load += new System.EventHandler(this.UCComboBox_Load);
this.SizeChanged += new System.EventHandler(this.UCComboBox_SizeChanged);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.click_MouseDown);
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.Panel panel1;
public TextBoxEx txtInput;
private System.Windows.Forms.Label lblInput;
}
}

用处及效果

最后的话

如果你喜欢的话,请到 https://gitee.com/kwwwvagaa/net_winform_custom_control 点个星 星吧

(三十五)c#Winform自定义控件-下拉框的更多相关文章

  1. (四十九)c#Winform自定义控件-下拉框(表格)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  2. CRM:异步加载下拉列表,三个列表出现同样的下拉框

    异步加载下拉列表,三个列表出现同样的下拉框,原因如下: Spring默认单例,如果Action是单例,那么上一次查询的结果就可能被下一次的查询所调用.所以必须配置action为多例, 如果采用单例模式 ...

  3. (四十八)c#Winform自定义控件-下拉按钮

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...

  4. android+myeclipse+mysql自定义控件下拉框的数据绑定

    原创作品,允许转载,转载时请务必声明作者信息和本声明.http://www.cnblogs.com/zhu520/p/8031936.html 本人小白,那个大神看到有问题可指出,谢谢.... 这个是 ...

  5. C# Winform 获得下拉框 选中的值

    string PrintName = cmbPrinter.SelectedIndex.ToString(); PrintName = cmbPrinter.SelectedItem.ToString ...

  6. (三十)c#Winform自定义控件-文本框(三)

    前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...

  7. “全栈2019”Java第三十五章:面向对象

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...

  8. table样式的下拉框(angularjs)

    前言 虽然使用的技术比较老了,但是思想却还是适用于现在的vue等框架. 一:实现的样式 二:实现包括的功能点 1:下拉框内容是表格,类似于一个弹窗 表格内容最多六行,超出的显示滚动条,表头固定,可滚动 ...

  9. jQuery无限级联下拉框插件

    自己编写jQuery插件 之 无限级联下拉框   因为是级联,所以数据必须是树型结构的,我这里的测试数据如下: 看下效果图: 1.>图一: 2.>图二: 3.>图三: 由图可知,下拉 ...

随机推荐

  1. Minikube安装成功Kubernetes,一次过!

    介绍 Minikube 是 K8S 官方为了开发者能在个人电脑上运行 K8S 而提供的一套工具.实现上是通过 Go 语言编写,通过调用虚拟化管理程序,创建出一个运行在虚拟机内的单节点集群. 注:从这里 ...

  2. Kotlin学习快速入门(2)——条件 数组 循环 方法

    条件 if条件判断 常用的判断和Java一样,这里提一下不同的用法 1.if可以作为三元运算符 val max = if (a > b) a else b 2.使用in判断是否在某个区间 val ...

  3. [算法]LeetCode 1.两数之和

    LeetCode 1.两数之和(python) 1.朴素解法 最朴素的两个for循环大法: class Solution: def twoSum(self, nums: List[int], targ ...

  4. jsp数据交互(二).3

    01.Application原理与应用 01.application对象的作用域范围是整个应用服务,而它在应用中所承担的责任就类似于一个全局变量.只要服务启动,则application对象就会存在. ...

  5. CountDownLatch实现多线程并发请求

    package com.test; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Dat ...

  6. 启动Eclipse提示找不到虚拟机

    由于硬盘坏了,把所有东西都清光了,今天重新安装Eclipse,出现了一点小插曲 安装的时候出现了这个画面,以前安装也是照着[软件安装管家]的发布装的,幸好还懂得几个英文单词,看了一下提示信息,直译:[ ...

  7. 比特平面分层(一些基本的灰度变换函数)基本原理及Python实现

    1. 基本原理 在灰度图中,像素值的范围为[0, 255],即共有256级灰度.在计算机中,我们使用8比特数来表示每一个像素值.因此可以提取出不同比特层面的灰度图.比特层面分层可用于图片压缩:只储存较 ...

  8. 我的第一个py爬虫-小白(beatifulsoup)

    一.基本上所有的python第一步都是安装.安装 我用到的第三方安装包(beatifulsoup4.re.requests).还要安装lxml 二.找个http开头的网址我找的是url="h ...

  9. CSS:抗锯齿 font-smoothing

    本文引自:http://www.cnblogs.com/sunshq/p/4595673.html -webkit-font-smoothing 这个属性可以使页面上的字体抗锯齿,使用后字体看起来会更 ...

  10. Jmeter使用csv文件读取测试数据

    最近有同事在测试过程中遇到需要造批量测试数据的问题,这些数据往往是同一种单据,但是单据的内容不同,如果手工创建就比较费时费力.那我们用jmeter的csv文件来读取测试数据就完美解决了这个问题. 我们 ...