title: Importing Custom Wpf Control Library DLL
body: <p>i made a WpfControlLibrary DLL to make a custom ProgressBar to import in a WindowsForm Project. The problem is, compiling and everything works fine.
  But when i try to import my dll by doing 
  ToolBox->Right Click->Choose Elements...->WPF Components->Browse...->Choose dll->ok
  it returns this error 
  '...pathofthedll...' Doesn't contain any components that could be insert in your toolbox.</p>
  
  <p>Here's the code of the WpfControlLibrary</p>
  
  <pre><code>&lt;ProgressBar xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="NewProgressBar"
    x:Name="ProgressBar" 
    Margin="20"
    Value="{Binding ElementName=progress, Path=Value}" Height="30" IsIndeterminate="False" Foreground="{DynamicResource BrushRed}" Width="300"&gt;
      &lt;ProgressBar.Resources&gt;
          &lt;SolidColorBrush x:Key="BrushRed" Color="#FFD30101"/&gt;
          &lt;SolidColorBrush x:Key="BrushGreen" Color="#FF27D301"/&gt;
          &lt;SolidColorBrush x:Key="BrushYellow" Color="#FFD3D301"/&gt;
      &lt;/ProgressBar.Resources&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>Public Class NewProgressBar
  Inherits ProgressBar
  
  Private mColor1 As SolidColorBrush
  Private mColor2 As SolidColorBrush
  Private mColor3 As SolidColorBrush
  Private mMaxValue As Integer = 100
  Private mCurrentValue As Double = 0
  
  
  Public Sub New(ByVal color1 As String, ByVal color2 As String, ByVal color3 As String)
  
      InitializeComponent()
  
      Dim Brush1 As New SolidColorBrush
      Brush1.Color = ConvertToRbg(color1)
      Me.mColor1 = Brush1
  
      Dim Brush2 As New SolidColorBrush
      Brush2.Color = ConvertToRbg(color2)
      Me.mColor2 = Brush2
  
      Dim Brush3 As New SolidColorBrush
      Brush3.Color = ConvertToRbg(color3)
      Me.mColor3 = Brush3
  
      Me.Resources.Add("BrushRed", Brush1)
      Me.Resources.Add("BrushYellow", Brush2)
      Me.Resources.Add("BrushGreen", Brush3)
  
  End Sub
  
  Public Property GetColor1() As String
      Get
          Return mColor1.Color.ToString
      End Get
      Set(value As String)
          Dim Brush As New SolidColorBrush
          Brush.Color = ConvertToRbg(value)
          Me.mColor1 = Brush
      End Set
  End Property
  
  Public Property GetColor2() As String
      Get
          Return mColor2.Color.ToString
      End Get
      Set(value As String)
          Dim Brush As New SolidColorBrush
          Brush.Color = ConvertToRbg(value)
          Me.mColor2 = Brush
      End Set
  End Property
  
  Public Property GetColor3() As String
      Get
          Return mColor3.Color.ToString
      End Get
      Set(value As String)
          Dim Brush As New SolidColorBrush
          Brush.Color = ConvertToRbg(value)
          Me.mColor3 = Brush
      End Set
  End Property
  
  Public Property GetMaxValue() As Integer
      Get
          Return mMaxValue
      End Get
      Set(value As Integer)
          mMaxValue = value
      End Set
  End Property
  
  Private Function ConvertToRbg(ByVal HexColor As String) As Color
      Dim Red As String
      Dim Green As String
      Dim Blue As String
      HexColor = Replace(HexColor, "#", "")
      Red = Val("&amp;H" &amp; Mid(HexColor, 1, 2))
      Green = Val("&amp;H" &amp; Mid(HexColor, 3, 2))
      Blue = Val("&amp;H" &amp; Mid(HexColor, 5, 2))
      Return Color.FromRgb(Red, Green, Blue)
  End Function
  
  Public Sub ChangeColor()
      Dim prgrss As Double = mCurrentValue / 100
  
      Dim redbrsh As SolidColorBrush = Me.Resources("BrushRed")
      Dim grnbrsh As SolidColorBrush = Me.Resources("BrushGreen")
      Dim ylwbrsh As SolidColorBrush = Me.Resources("BrushYellow")
  
  
      If prgrss = 1D Then
  
          Me.Foreground = grnbrsh
  
      ElseIf prgrss &gt;= 0.95D And prgrss &lt; 1D Then
  
          Me.Foreground = ylwbrsh
      Else
          Me.Foreground = redbrsh
      End If
  
      Dim number As Integer = prgrss
  
  
  
  End Sub
  
  Public Sub ChangeValue(ByVal value As Integer)
      Me.Value = (100 * value) / mMaxValue
      mCurrentValue = Me.Value
  End Sub
  </code></pre>
  
  <p>End Class</p>