Click here to Skip to main content
15,914,225 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: What is the equivalent VB.net for this C code? Pin
_AK_19-Sep-06 1:53
_AK_19-Sep-06 1:53 
QuestionConvert String to Date [modified] Pin
VK-Cadec18-Sep-06 3:32
VK-Cadec18-Sep-06 3:32 
AnswerRe: Convert String to Date Pin
IlanTal18-Sep-06 3:55
IlanTal18-Sep-06 3:55 
GeneralRe: Convert String to Date Pin
VK-Cadec18-Sep-06 4:04
VK-Cadec18-Sep-06 4:04 
AnswerRe: Convert String to Date Pin
Guffa18-Sep-06 9:30
Guffa18-Sep-06 9:30 
AnswerRe: Convert String to Date Pin
Hamid_RT19-Sep-06 8:10
Hamid_RT19-Sep-06 8:10 
QuestionComponent properties Pin
Akbar Qofrani18-Sep-06 3:08
Akbar Qofrani18-Sep-06 3:08 
AnswerSolved and new problem Pin
Akbar Qofrani19-Sep-06 1:28
Akbar Qofrani19-Sep-06 1:28 
Hi I solved my problem by myself but I have another one.
When I set my control properties every thing is ok but after I run my project I lose my colllection properties value.
How can I solve this problem please help me.
Here is my code :
<br />
Imports System<br />
Imports System.ComponentModel<br />
Imports System.Drawing<br />
Imports System.Drawing.Design<br />
Imports System.ComponentModel.TypeConverter<br />
<br />
'My properties class<br />
Public Class ToolBoxItem<br />
<br />
#Region "Properies"<br />
<br />
    Private m_IName As String<br />
<br />
    Private m_Value As Integer<br />
<br />
    Public Property IName() As String<br />
        Get<br />
<br />
            Return m_IName<br />
<br />
        End Get<br />
        Set(ByVal Value As String)<br />
<br />
            m_IName = Value<br />
<br />
        End Set<br />
    End Property<br />
<br />
    Public Property Value() As Integer<br />
        Get<br />
<br />
            Return m_Value<br />
<br />
        End Get<br />
        Set(ByVal Value As Integer)<br />
<br />
            m_Value = Value<br />
<br />
        End Set<br />
    End Property<br />
<br />
#End Region<br />
<br />
End Class<br />
<br />
<br />
'My collection class<br />
Public Class ToolBoxItemCollection<br />
<br />
    Inherits CollectionBase<br />
<br />
    Public Sub Add(ByVal MyItem As ToolBoxItem)<br />
<br />
        list.Add(MyItem)<br />
<br />
    End Sub<br />
<br />
    Public Sub Remove(ByVal index As Integer)<br />
<br />
        If index > Count - 1 Or index < 0 Then<br />
<br />
            System.Windows.Forms.MessageBox.Show("Index not valid!")<br />
<br />
        Else<br />
<br />
            List.RemoveAt(index)<br />
<br />
        End If<br />
<br />
    End Sub<br />
<br />
<br />
    Public ReadOnly Property Item(ByVal index As Integer) As ToolBoxItem<br />
        Get<br />
<br />
            Return CType(List.Item(index), ToolBoxItem)<br />
<br />
        End Get<br />
<br />
    End Property<br />
<br />
End Class<br />
<br />
'My control class<br />
Public Class ToolBox<br />
<br />
    Inherits GroupBox<br />
<br />
    Private m_Items As ToolBoxItemCollection<br />
<br />
    Private m_Count, m_ItemWidth, m_ItemHeight As Integer<br />
<br />
<br />
    Public Property Items() As ToolBoxItemCollection<br />
        Get<br />
<br />
            Return m_Items<br />
<br />
        End Get<br />
        Set(ByVal Value As ToolBoxItemCollection)<br />
<br />
            m_Items = Value<br />
<br />
        End Set<br />
    End Property<br />
<br />
<br />
    Public Property Items(ByVal Index As Integer) As ToolBoxItem<br />
        Get<br />
            Return m_Items.Item(Index)<br />
<br />
        End Get<br />
        Set(ByVal Value As ToolBoxItem)<br />
<br />
            m_Items.Add(Value)<br />
<br />
        End Set<br />
    End Property<br />
<br />
    Public Sub New()<br />
<br />
        MyBase.New()<br />
<br />
        Me.Dock = DockStyle.Right<br />
<br />
        Me.BackColor = SystemColors.ControlDarkDark<br />
<br />
        Me.Text = ""<br />
<br />
        Me.Width = 100<br />
<br />
        If m_Items Is Nothing Then<br />
<br />
            m_Items = New ToolBoxItemCollection<br />
<br />
        End If<br />
<br />
    End Sub<br />
<br />
<br />
End Class<br />
<br />


Thanks
Qofrani
Questionhow to draw a graph? Pin
IlanTal18-Sep-06 3:04
IlanTal18-Sep-06 3:04 
AnswerRe: how to draw a graph? Pin
Dave Kreskowiak18-Sep-06 7:19
mveDave Kreskowiak18-Sep-06 7:19 
GeneralRe: how to draw a graph? Pin
IlanTal19-Sep-06 0:04
IlanTal19-Sep-06 0:04 
GeneralRe: how to draw a graph? Pin
Dave Kreskowiak19-Sep-06 2:16
mveDave Kreskowiak19-Sep-06 2:16 
GeneralRe: how to draw a graph? Pin
IlanTal19-Sep-06 3:17
IlanTal19-Sep-06 3:17 
AnswerRe: how to draw a graph? Pin
Alex@UEA18-Sep-06 21:28
Alex@UEA18-Sep-06 21:28 
GeneralRe: how to draw a graph? Pin
IlanTal19-Sep-06 0:08
IlanTal19-Sep-06 0:08 
GeneralRe: how to draw a graph? Pin
Alex@UEA19-Sep-06 1:09
Alex@UEA19-Sep-06 1:09 
GeneralRe: how to draw a graph? Pin
IlanTal19-Sep-06 5:03
IlanTal19-Sep-06 5:03 
QuestionLock/Hide folder Pin
zenithmaximus18-Sep-06 3:01
zenithmaximus18-Sep-06 3:01 
AnswerRe: Lock/Hide folder Pin
Dave Kreskowiak18-Sep-06 7:23
mveDave Kreskowiak18-Sep-06 7:23 
AnswerRe: Lock/Hide folder Pin
Hamid_RT19-Sep-06 8:10
Hamid_RT19-Sep-06 8:10 
GeneralRe: Lock/Hide folder Pin
Dave Kreskowiak19-Sep-06 8:19
mveDave Kreskowiak19-Sep-06 8:19 
QuestionCUSTIOM ACTION DIALOGUE BOXES Pin
vilunjike manda18-Sep-06 2:25
vilunjike manda18-Sep-06 2:25 
AnswerRe: CUSTIOM ACTION DIALOGUE BOXES Pin
Dave Kreskowiak18-Sep-06 7:26
mveDave Kreskowiak18-Sep-06 7:26 
GeneralRe: CUSTIOM ACTION DIALOGUE BOXES Pin
vilunjike manda18-Sep-06 20:44
vilunjike manda18-Sep-06 20:44 
GeneralRe: CUSTIOM ACTION DIALOGUE BOXES Pin
Dave Kreskowiak19-Sep-06 2:07
mveDave Kreskowiak19-Sep-06 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.