Click here to Skip to main content
15,913,709 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Using Assembly with multiple versions Pin
nitin_ion6-Mar-07 16:27
nitin_ion6-Mar-07 16:27 
QuestionControling the Button in Window Form Pin
drexler_kk6-Mar-07 4:18
drexler_kk6-Mar-07 4:18 
AnswerRe: Controling the Button in Window Form Pin
JUNEYT6-Mar-07 5:22
JUNEYT6-Mar-07 5:22 
GeneralRe: Controling the Button in Window Form Pin
drexler_kk6-Mar-07 18:55
drexler_kk6-Mar-07 18:55 
QuestionIntergrate program in Windows Pin
johnjsm6-Mar-07 3:32
johnjsm6-Mar-07 3:32 
AnswerRe: Intergrate program in Windows Pin
Richard Jones6-Mar-07 3:45
Richard Jones6-Mar-07 3:45 
GeneralRe: Intergrate program in Windows Pin
johnjsm6-Mar-07 3:56
johnjsm6-Mar-07 3:56 
QuestionSort a collection class? Pin
DA_Loring6-Mar-07 3:03
DA_Loring6-Mar-07 3:03 
Does anyone have any idea how I can go about sorting a collection class.

The elements of the class are:

Public PointData As Double
Public RateData As Double
Public TimeData As Double

The requirement is to sort on one of the following:

PointData (asc) + RateData (Desc) or
PointData (Desc)

Any help would be very much appreciated!! Sleepy | :zzz:

The code of the class collection is:

Public Class CPRTData
Public PointData As Double
Public RateData As Double
Public TimeData As Double
' Private data for the write-once ID property.
Private mstrID As String
' The first time the ID property is set, the static
' Boolean is also set. Subsequent calls return !ERROR! in the ID.

Public Property ID() As String
Get
ID = mstrID
End Get
Set(ByVal Value As String)
Static blnAlreadySet As Boolean

If Not blnAlreadySet Then
blnAlreadySet = True
mstrID = Value
Else
mstrID = "!ERROR!"
End If
End Set
End Property
End Class

Public Class CPRTDataItems
Implements System.Collections.IEnumerable
'local variable to hold collection
Private mCol As Collection

Public Function Add() As String
'create a new object
Dim objNewMember As CPRTData
Dim sKey As String = ""

sKey = "R" & Format(mCol.Count + 1, "0000")
objNewMember = New CPRTData
objNewMember.ID = sKey
'set the properties passed into the method
mCol.Add(objNewMember, sKey)
'return the object created
Add = objNewMember.ID
objNewMember = Nothing
End Function

Public Function GetEnumerator() As System.Collections.IEnumerator _
Implements System.Collections.IEnumerable.GetEnumerator
GetEnumerator = mCol.GetEnumerator
End Function

Public Sub Clear()
Dim iLoopVar As Integer

For iLoopVar = mCol.Count To 1 Step -1
Remove(iLoopVar)
Next
End Sub

Public Function Count() As Integer
Count = mCol.Count()
End Function

Default Public ReadOnly Property Item(ByVal Index As Object) As CPRTData
Get
Item = mCol.Item(Index)
End Get
End Property

Public Sub Remove(ByRef vntIndexKey As Object)
'used when removing an element from the collection
'vntIndexKey contains either the Index or Key, which is why
'it is declared as a Variant(Object)
'Syntax: x.Remove(xyz)
mCol.Remove(vntIndexKey)
End Sub

Private Sub Class_Kickstart()
'creates the collection when this class is created
mCol = New Collection
End Sub

Public Sub New()
MyBase.New()
Class_Kickstart()
End Sub

Private Sub Class_Shutdown()
'destroys collection when this class is terminated
mCol = Nothing
End Sub

Protected Overrides Sub Finalize()
Class_Shutdown()
MyBase.Finalize()
End Sub
End Class


David Loring
!! Keep Music Live !!
AnswerRe: Sort a collection class? Pin
kubben6-Mar-07 3:27
kubben6-Mar-07 3:27 
GeneralRe: Sort a collection class? Pin
DA_Loring6-Mar-07 3:33
DA_Loring6-Mar-07 3:33 
QuestionHow to ping in vb.net Pin
TECABA6-Mar-07 2:51
TECABA6-Mar-07 2:51 
AnswerRe: How to ping in vb.net Pin
nlarson116-Mar-07 3:38
nlarson116-Mar-07 3:38 
GeneralRe: How to ping in vb.net Pin
TECABA6-Mar-07 3:50
TECABA6-Mar-07 3:50 
GeneralRe: How to ping in vb.net Pin
nlarson116-Mar-07 4:01
nlarson116-Mar-07 4:01 
GeneralRe: How to ping in vb.net Pin
TECABA6-Mar-07 4:16
TECABA6-Mar-07 4:16 
Questionhow to add .00 to number in datagrid Pin
Amit Sk Sharma6-Mar-07 0:53
Amit Sk Sharma6-Mar-07 0:53 
AnswerRe: how to add .00 to number in datagrid Pin
kane6-Mar-07 1:16
kane6-Mar-07 1:16 
AnswerRe: how to add .00 to number in datagrid Pin
Christian Graus6-Mar-07 1:28
protectorChristian Graus6-Mar-07 1:28 
Questionvb.net datagrid Pin
sukanyadutta6-Mar-07 0:24
sukanyadutta6-Mar-07 0:24 
AnswerRe: vb.net datagrid Pin
Amit Sk Sharma6-Mar-07 0:59
Amit Sk Sharma6-Mar-07 0:59 
QuestionMenu bars Pin
Member 38798816-Mar-07 0:03
Member 38798816-Mar-07 0:03 
AnswerRe: Menu bars Pin
Jwalant Natvarlal Soneji6-Mar-07 21:19
Jwalant Natvarlal Soneji6-Mar-07 21:19 
QuestionHow to submit my articles?...... Pin
Member 38798815-Mar-07 23:54
Member 38798815-Mar-07 23:54 
AnswerRe: How to submit my articles?...... Pin
JUNEYT6-Mar-07 0:21
JUNEYT6-Mar-07 0:21 
GeneralRe: How to submit my articles?...... Pin
Member 38798816-Mar-07 0:43
Member 38798816-Mar-07 0:43 

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.