Ⅰ 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的工具箱給關了,怎麼調出來到界面
找到菜單-》視圖-》工具箱即可