导航:首页 > 五金知识 > 类似vs工具箱

类似vs工具箱

发布时间:2022-07-31 22:34:06

① 我想在软件中加一个类似于VS工具箱的窗口,c#中有这种控件吗

1.可以直接分组的控件有,treeView
2.像qq一样的分组:自己用BUTTON或者PANEL写一个,可以用location货dock来改变
3.自己写控件,其实很简单的,DOWNLOAD点资料就ok了
4.第三方调用,比如DevComponents
记得给我点分哦!http://www.dotnetmagic.com/downloads/Magic174AndKrypton.zip
还有用NavBarControl这个,下载地址自己找
或者重写treeview
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace SiteView.Ecc.MMC.UserContorls
{

/// <summary>
/// 继承TreeView控件,实现VS工具箱风格
/// </summary>
class ToolBox :TreeView
{

public ToolBox()
{

this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.SetStyle(ControlStyles.EnableNotifyMessage, true);

this.ShowLines = false;
this.HotTracking = true;
this.FullRowSelect = true;
this.DrawMode = TreeViewDrawMode.OwnerDrawAll;

this.Nodes.Add("test");
}

/// <summary>
/// 重新DrawNode方法
/// </summary>
/// <param name="e"></param>
protected override void OnDrawNode(DrawTreeNodeEventArgs e)
{

//base.OnDrawNode(e);
if(e.Node.Level == 0)
{
DrawRoot(e);
}
else
{
DrawItem(e);
}

}

/// <summary>
/// 绘制根节点
/// </summary>
/// <param name="e"></param>
private void DrawRoot(DrawTreeNodeEventArgs e)
{

try
{
Rectangle rect = e.Bounds;
rect.Y += 1;
rect.Width -= 1;
rect.Height -= 3;

if(e.Node.IsSelected)
//if (e.State == TreeNodeStates.Marked || e.State == TreeNodeStates.Selected)
{
using (System.Drawing.Brush selBrush = new System.Drawing.SolidBrush(Color.FromArgb(225, 230, 232)))
using (System.Drawing.Pen outerPen = new System.Drawing.Pen(Color.FromArgb(49, 106, 197)))
{
e.Graphics.FillRectangle(selBrush, rect);
e.Graphics.DrawRectangle(outerPen, rect);
}
}
else
{
using (System.Drawing.Drawing2D.LinearGradientBrush lgBrush = new System.Drawing.Drawing2D.LinearGradientBrush(e.Bounds, Color.FromArgb(221, 220, 203), Color.FromArgb(196, 193, 176), LinearGradientMode.Vertical))
using (System.Drawing.Pen linePen = new System.Drawing.Pen(this.BackColor))
{
e.Graphics.FillRectangle(lgBrush, rect);
e.Graphics.DrawLine(linePen, 0, rect.Bottom - 2, rect.Width, rect.Bottom - 2);
}
}
if (e.Node.IsExpanded == true)
{
//e.Graphics.DrawImage(this.imageList3.Images[0], new Point(rect.Left + 3, rect.Top + 4));
e.Graphics.DrawImage(IconResource.expanded, new Rectangle(rect.Left + 3, rect.Top + 4, 10, 10));
}
else
{
e.Graphics.DrawImage(IconResource.collapsed, new Rectangle(rect.Left + 3, rect.Top + 4, 10, 10));
}

rect.Offset(16, 2);
e.Graphics.DrawString(e.Node.Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(0))), SystemBrushes.ControlText, rect.Location);
}
catch (Exception ex)
{
//隐藏错误
//log.Error("绘制根节点", ex);
}

}

private System.Drawing.Brush selBrush = new System.Drawing.SolidBrush(Color.FromArgb(175, Color.Gold));
private System.Drawing.Pen pen = SystemPens.HotTrack;
/// <summary>
/// 绘制子结点
/// </summary>
/// <param name="e"></param>
private void DrawItem(DrawTreeNodeEventArgs e)
{

try
{
Rectangle nodeTextRect = e.Bounds;

nodeTextRect.Width -= 1;
nodeTextRect.Height -= 1;

Rectangle rect = e.Bounds;
rect.Inflate(-1, -1);

if (e.Node.IsSelected)
{
e.Graphics.FillRectangle(selBrush, rect);
e.Graphics.DrawRectangle(pen, rect);
}
else
{
e.Graphics.FillRectangle(new System.Drawing.SolidBrush(e.Node.BackColor), e.Bounds);
e.Graphics.DrawRectangle(new System.Drawing.Pen(e.Node.BackColor), e.Bounds);
}

if (this.ImageList != null && e.Node.ImageIndex < this.ImageList.Images.Count)
{
e.Graphics.DrawImage(this.ImageList.Images[e.Node.ImageIndex], new Point(e.Bounds.Left + 3, e.Bounds.Top + 2));
}

nodeTextRect.Offset(20, 3);
e.Graphics.DrawString(e.Node.Text, this.Font, SystemBrushes.ControlText, nodeTextRect.Location);

}
catch (Exception ex)
{
//隐藏错误
//log.Error("绘制子节点", ex);
}
}
}
}
还有两个资源文件,一个加号图片(IconResource.expanded),一个减号图片(IconResource.collapsed)。你自己做两张图片加进去

② Extended WPF Toolkit中有没有类似VS工具箱的那种可隐藏的侧边栏控件,是哪一个,全英文完全看不懂

用复AvalonDock 这个库,制
[原译]AVALONDOCK 2.0入门指南第一部分 - lazycoding - 博客园
http://www.cnblogs.com/lazycoding/archive/2012/09/27/2705025.html

③ C#创建可视属性窗体,想实现类似VS编辑器一样的,在右边显示控件属性

很简单:

1.在工具箱中拖一个PropertyGrid控件,

2.然后把你要设置属性的控件给propertyGrid的SelectedObject指定。

如:this.propertyGrid1.SelectedObject=this.groupBox1;

④ VS2010工具箱,或者DotNetBar中,是否有类似domainUpDown控件 通过上下箭头,进行数值增加或者减少

这个是第三方的吧,默认的是没有的,你可以自己写一个试试,网页上按钮或a标签是可以绑定键盘的

⑤ c# 类似vs的工具箱的可伸展收缩 控件 怎么实现

dockpane,网上教程很多,线程的控件。下面版是下载地址。权
http://sourceforge.net/projects/dockpanelsuite/

⑥ 在sharpdevelop有没有控件 像VS2013中工具箱的那些控件在哪里比如按钮,textbox等 等

如图点击设计(Design)切换下就OK了!!当然首先要在视图里选择工具(tools)

⑦ c#中有没有类似vs2010的工具箱的目录控件,各位大神跪求答案。

TreeView控件,树形目录,不会用的话可以追问!

⑧ c#有没有像vs10工具箱这样的控件

你截图的是PropertyGrid

⑨ c# 折叠菜单 类似于VS中左侧的工具箱那种 知道的求不吝解答,有类似源码也可以。

之前做过一个,是在vs中使用了ajax的控件包,里面有一个折叠面板的控件,你可以用这个来实现内,很简单容,只需要下载一个ajax的dll之后,直接拖控件即可,控件名称是:
Accordion:可折叠面板的集合(Accordion控件中可以包含若干个面板,让用户通过点击不同面板的标题栏一次只展开并显示其中的一个内容,就像将好多个CollapsiblePanel堆到了一起。)希望可以帮到你

阅读全文

与类似vs工具箱相关的资料

热点内容
肉桂酸熔点实验的装置图 浏览:249
上汽大通G10仪表里程怎么调 浏览:455
挂车发电机轴承怎么换 浏览:187
净水器接燃气阀门 浏览:714
1t机械硬盘供电多少 浏览:637
上楼搬运助力机械装置 浏览:913
自动剪线绷缝机装置 浏览:671
2子宫有哪些固定装置各起什么作用 浏览:589
机械搅拌通风发酵罐是怎么工作的 浏览:455
青岛巨型抛光设备哪里有 浏览:144
天然气管道外面的阀门在哪个位置 浏览:396
crv仪表盘出现扳手什么意思 浏览:618
开料机自动上下料装置 浏览:7
莱州东升阀门厂有限公司 浏览:379
单个轴承晃动怎么解决 浏览:739
cad煤气管道阀门 浏览:992
店透视工具箱准吗 浏览:438
机械制造厂有多少车间 浏览:116
帕萨特仪表灯暗怎么调 浏览:286
超声波为什么不能用塑料模 浏览:566