Ⅰ vs2017 工具箱 没有安装工具集选项
在你已有的项目的基础上,点击“视图”会出现下面图片的内容,然后点击“版工具箱权”,跳到第2步骤。
Ⅱ 如何在VS工具箱中添加DevExpress控件
现在的选项应该是:“全部显示”。其实那么多项目,是因为VS是个大杂烩,每个语版言和模板只支持一部权分控件,你不能拿office的控件简单的放到MFC程序中。
在工具箱中右键,去掉“显示全部”,才是MFC对话框可用控件。
如果希望使用MFC支持的非标准控件,在对话框上空白处右键,选择“插入ActiveX控件”即可。
Ⅲ 我想在软件中加一个类似于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)。你自己做两张图片加进去
Ⅳ vs2017在工具栏里没有控件是怎么回事
解决:工具箱里边没了Dev控件用VS新打开一个项目,居然发现工具箱里边没了Dev控件。回网上答找了下,找到如下解决方案,搞定了! 输入 "d:"定位到D盘 输入"cd"+" "+"(文件路径)" 定位到Dev控件的安装目录下的\Components\Tools文件夹下,执行如下命
Ⅳ 如图,VS2017新建MFC对话框之后,工具箱控件不可用怎么办
VS2017新建MFC对话框之后,工具箱控件不可用是设置错误造成的,解决方法为:
1、启动VS2017软件。在VS2017界面的菜单栏中,点击“文件 > 新建 > 项目”,打开“新建项目”窗口。
Ⅵ visual studio 打开工具箱没有可用的控件,提示说“将某项拖至此文本可将其添加到工具箱”,应该怎么办
1、在你已有的项目的基础上点击“工具栏”。
Ⅶ vs2017创建基于对话框的mfc应用程序没有对话框,工具箱也是灰色的 ,怎么回事
点右边的"资源视图", 找到"MFCApplication2Dlg", 双击
Ⅷ vs2012 MFC编程中怎么找到工具箱
菜单栏 --> 视图--->工具箱 ---->在工具箱窗口右键--->选择全部显示,即可显示全部控件
简单的办法:
打开工具箱后,如果没有控件显示---->切换到资源管理视图--->选中一个对话框即可
Ⅸ vs2015工具箱在菜单栏怎么找到
菜单栏的“视图”-->“工具箱”
Ⅹ 我把vs的工具箱给关了,怎么调出来到界面
找到菜单-》视图-》工具箱即可