(三十五)c#Winform自定义控件-下拉框
官网
前提
入行已经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
准备工作
此控件用到了停靠窗体和日期控件的一个面板,以及基类控件,如果你还对此不了解,请移步
开始
添加一个用户控件,命名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自定义控件-下拉框的更多相关文章
- (四十九)c#Winform自定义控件-下拉框(表格)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- CRM:异步加载下拉列表,三个列表出现同样的下拉框
异步加载下拉列表,三个列表出现同样的下拉框,原因如下: Spring默认单例,如果Action是单例,那么上一次查询的结果就可能被下一次的查询所调用.所以必须配置action为多例, 如果采用单例模式 ...
- (四十八)c#Winform自定义控件-下拉按钮
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. GitHub:https://github.com/kwwwvagaa/NetWinformControl 码云:ht ...
- android+myeclipse+mysql自定义控件下拉框的数据绑定
原创作品,允许转载,转载时请务必声明作者信息和本声明.http://www.cnblogs.com/zhu520/p/8031936.html 本人小白,那个大神看到有问题可指出,谢谢.... 这个是 ...
- C# Winform 获得下拉框 选中的值
string PrintName = cmbPrinter.SelectedIndex.ToString(); PrintName = cmbPrinter.SelectedItem.ToString ...
- (三十)c#Winform自定义控件-文本框(三)
前提 入行已经7,8年了,一直想做一套漂亮点的自定义控件,于是就有了本系列文章. 开源地址:https://gitee.com/kwwwvagaa/net_winform_custom_control ...
- “全栈2019”Java第三十五章:面向对象
难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...
- table样式的下拉框(angularjs)
前言 虽然使用的技术比较老了,但是思想却还是适用于现在的vue等框架. 一:实现的样式 二:实现包括的功能点 1:下拉框内容是表格,类似于一个弹窗 表格内容最多六行,超出的显示滚动条,表头固定,可滚动 ...
- jQuery无限级联下拉框插件
自己编写jQuery插件 之 无限级联下拉框 因为是级联,所以数据必须是树型结构的,我这里的测试数据如下: 看下效果图: 1.>图一: 2.>图二: 3.>图三: 由图可知,下拉 ...
随机推荐
- cve-2018-14515复现
一.环境 Windows NT WIN-RRI9T9SN85D 6.1 build 7600 (Windows 7 Business Edition) i586 Apache/2.4.23 (Win3 ...
- libvirt-qemu-TLS加密虚拟机传输实例分析
说明 TLS(Transport Layer Security Protocol),即安全传输层协议,其核心是加密两台计算机之间的通信.libvirt中使用TLS,可以实现libvirt的安全加密.可 ...
- (读论文)推荐系统之ctr预估-DeepFM模型解析
今天第二篇(最近更新的都是Deep模型,传统的线性模型会后面找个时间更新的哈).本篇介绍华为的DeepFM模型 (2017年),此模型在 Wide&Deep 的基础上进行改进,成功解决了一些问 ...
- phpcms V9 常用的调用标签
本文介绍phpcms v9中模板标签使用说明. >>调用根目录下phpcms\template\content\header文件 {template "content" ...
- Spring + RocketMQ使用
本文所介绍环境为win7环境下运行, 从官方github中(https://github.com/alibaba/RocketMQ)下载RocketMQ-master.zip,版本为v3.5.8,解压 ...
- python课堂整理20----生产者消费者模型
一.实现功能:店铺生产包子,消费者来吃 import time def producter(): ret = [] for i in range(10): time.sleep(0.1) ret.ap ...
- linux初学者-iscsi篇
linux初学者-iscsi篇 之前介绍过网络文件共享系统NFS和CIFS.在系统中,设备也是可以共享的,这就是iSCSI,它可以用来建立和管理IP存储设备.主机和客户机等之间的相互 ...
- python requests、xpath爬虫增加博客访问量
这是一个分析IP代理网站,通过代理网站提供的ip去访问CSDN博客,达到以不同ip访同一博客的目的,以娱乐为主,大家可以去玩一下. 首先,准备工作,设置User-Agent: #1.headers h ...
- 那些年,想和你一起认识的SpringCloud Eureka
前几天鲁班LB跟我说:你玩把游戏都要半个钟啦,为何不用这时间来看看书,如果涨工资还可以帮我买个皮肤. 面对如此合理的这需求,但我不以为然,事实上并不是我不想学习,而是 ↓ 实力不允许呀~ 直到有一天, ...
- 模拟器无Back、Menu等键
问题如图所示: 解决方法: 1. 打开Android Virtual Device (AVD) Manager --> 选择模拟器,并点击edit --> 勾选KeyBoard中的选项,并 ...