VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 307,124 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,045 people online right now. Registration is fast and FREE... Join Now!




[2008] Type Converter Question

 

[2008] Type Converter Question

Tim A

25 Sep, 2009 - 03:17 PM
Post #1

New D.I.C Head
*

Joined: 3 Apr, 2008
Posts: 32

I have written a Type Converter for a TrackBar. I was wondering if there is any way to get the value being changed in the Dropdown so I can update the PropertyGrid item value dynamically instead of just at the end?

Here is the Type Converter code:

CODE
Imports System.Windows.Forms.Design

Public Class Slider
    Private editorService As IWindowsFormsEditorService

    Private m_Value As Integer

    Public Property Value() As Integer
        Get
            Return m_Value
        End Get
        Set(ByVal value As Integer)
            m_Value = value
        End Set
    End Property

    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        tbSlider.LargeChange = 25
        tbSlider.SmallChange = 10
        tbSlider.TickFrequency = 15
        tbSlider.Maximum = 255
        tbSlider.Minimum = 0
        tbSlider.Size = Me.Size

        Me.editorService = editorService

    End Sub

    Public Sub New(ByVal MyValue As Integer, ByVal MyLargeChange As Integer, ByVal MySmallChange As Integer, ByVal MyTickFrequency As Integer, ByVal MyMinimum As Integer, ByVal MyMaximum As Integer, ByVal editorService As IWindowsFormsEditorService)
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        tbSlider.LargeChange = MyLargeChange
        tbSlider.SmallChange = MySmallChange
        tbSlider.TickFrequency = MyTickFrequency
        tbSlider.Maximum = MyMaximum
        tbSlider.Minimum = MyMinimum
        tbSlider.Value = MyValue

        Me.editorService = editorService

    End Sub

    Private Sub tbSlider_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbSlider.ValueChanged

        m_Value = CInt(tbSlider.Value)
    End Sub
End Class


Here is the Property Code:


CODE
    <System.ComponentModel.Category("Appearance"), _
    System.ComponentModel.DefaultValue("200"), _
    System.ComponentModel.Editor(GetType(OpacitySliderEditor), GetType(System.Drawing.Design.UITypeEditor)), _
    System.ComponentModel.Description("Value that represents a change in the Opacity or transparency of the control.")> _
    Public Property Opacity() As Integer
        Get
            Return m_Opacity
        End Get
        Set(ByVal value As Integer)
            m_Opacity = value
            SetBkImage()
            Me.Invalidate()
        End Set
    End Property




User is offlineProfile CardPM
+Quote Post


PsychoCoder

RE: [2008] Type Converter Question

25 Sep, 2009 - 04:16 PM
Post #2

I Code, Therefore I am
Group Icon

Joined: 26 Jul, 2007
Posts: 14,934



Thanked: 517 times
Dream Kudos: 11575
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Moved to VB.NET, the VB.NET Programmers forum isn't the right place for this thread smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 02:15PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month