Click here to Skip to main content
15,748,249 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionPrint Out Problem in Billing system??? Pin
JC.KaNNaN5-Jul-09 19:32
JC.KaNNaN5-Jul-09 19:32 
AnswerRe: Print Out Problem in Billing system??? Pin
EliottA6-Jul-09 2:53
EliottA6-Jul-09 2:53 
QuestionWrite to a word doc which is already open. Pin
Musa Biralo5-Jul-09 16:47
Musa Biralo5-Jul-09 16:47 
AnswerRe: Write to a word doc which is already open. Pin
Christian Graus5-Jul-09 17:03
protectorChristian Graus5-Jul-09 17:03 
QuestionSorting a structure array Pin
Jacob Dixon5-Jul-09 11:53
Jacob Dixon5-Jul-09 11:53 
AnswerRe: Sorting a structure array Pin
Luc Pattyn5-Jul-09 12:40
sitebuilderLuc Pattyn5-Jul-09 12:40 
GeneralRe: Sorting a structure array Pin
Jacob Dixon5-Jul-09 12:44
Jacob Dixon5-Jul-09 12:44 
AnswerRe: Sorting a structure array Pin
Gideon Engelberth5-Jul-09 12:44
Gideon Engelberth5-Jul-09 12:44 
I think you should look to use the overload of Array.Sort that takes an IComparer(Of T)

The comparer would look something like this (WARNING: code typed directly into the reply)

Friend Class TranslationSorter
  Implements IComparer(Of Translate)

  Public Function Compare(ByVal x as Translate, ByVal y as Translate) as Integer
    'you will need null checks here to decide how to sort in nulls

    'this will use the default sort order for strings
    Return x.English.CompareTo(y.English)
  End Function
End Class

Array.Sort(yourArray, New TranslationSorter)


With this approach, you could add a language property to the TranslationSorter class to make it do other languages.

On an unrelated note, StreamReader has an EndOfStream property instead of needing to do .Peek() >= 0
GeneralRe: Sorting a structure array Pin
Jacob Dixon5-Jul-09 13:52
Jacob Dixon5-Jul-09 13:52 
GeneralRe: Sorting a structure array Pin
Gideon Engelberth5-Jul-09 15:56
Gideon Engelberth5-Jul-09 15:56 
GeneralRe: Sorting a structure array Pin
Jacob Dixon5-Jul-09 15:59
Jacob Dixon5-Jul-09 15:59 
GeneralRe: Sorting a structure array Pin
Luc Pattyn6-Jul-09 0:46
sitebuilderLuc Pattyn6-Jul-09 0:46 
QuestionDrag&Drop problem Pin
The real $M@5-Jul-09 0:17
The real $M@5-Jul-09 0:17 
AnswerRe: Drag&Drop problem Pin
Mycroft Holmes5-Jul-09 2:14
professionalMycroft Holmes5-Jul-09 2:14 
GeneralRe: Drag&Drop problem Pin
Henry Minute5-Jul-09 4:18
Henry Minute5-Jul-09 4:18 
GeneralRe: Drag&Drop problem Pin
Mycroft Holmes5-Jul-09 14:10
professionalMycroft Holmes5-Jul-09 14:10 
AnswerRe: Drag&Drop problem Pin
Alan N5-Jul-09 4:05
Alan N5-Jul-09 4:05 
GeneralRe: Drag&Drop problem Pin
The real $M@5-Jul-09 22:04
The real $M@5-Jul-09 22:04 
QuestionAccess Database Path using vb.net[modified] Pin
mirzamujib4-Jul-09 23:09
mirzamujib4-Jul-09 23:09 
AnswerRe: Access Database Path using vb.ne Pin
dan!sh 5-Jul-09 2:30
professional dan!sh 5-Jul-09 2:30 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib5-Jul-09 3:58
mirzamujib5-Jul-09 3:58 
GeneralRe: Access Database Path using vb.ne Pin
dan!sh 5-Jul-09 5:19
professional dan!sh 5-Jul-09 5:19 
GeneralRe: Access Database Path using vb.ne Pin
JC.KaNNaN5-Jul-09 19:36
JC.KaNNaN5-Jul-09 19:36 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib6-Jul-09 1:29
mirzamujib6-Jul-09 1:29 
GeneralRe: Access Database Path using vb.ne Pin
mirzamujib6-Jul-09 0:25
mirzamujib6-Jul-09 0:25 

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.