Click here to Skip to main content
15,881,898 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 7:47
kubben21-Feb-07 7:47 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 8:03
Dante X21-Feb-07 8:03 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 8:16
kubben21-Feb-07 8:16 
GeneralRe: Executing a .NET exe from VBA Pin
Dante X21-Feb-07 9:01
Dante X21-Feb-07 9:01 
GeneralRe: Executing a .NET exe from VBA Pin
kubben21-Feb-07 9:16
kubben21-Feb-07 9:16 
AnswerRe: Executing a .NET exe from VBA [modified] Pin
Dante X21-Feb-07 11:19
Dante X21-Feb-07 11:19 
QuestionThe randmize function using listboxes Pin
China-Gary21-Feb-07 2:16
China-Gary21-Feb-07 2:16 
AnswerRe: The randmize function using listboxes Pin
TwoFaced21-Feb-07 8:05
TwoFaced21-Feb-07 8:05 
You'll need to add each textbox to a list and then randomly select which one you want. Once you pick the textbox you set the text and remove it from the list so it's not chosen again. This should work for you.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'This list will contain our textboxes
    Dim itemList As New List(Of TextBox)
    'Add each textbox to the list
    itemList.AddRange(New TextBox() { _
        txt1, _
        txt2, _
        txt3, _
        txt4, _
        txt5, _
        txt6})

    Dim rnd As New Random   'Random number generator
    For i As Int16 = 0 To lstListbox.Items.Count - 1
        'Pick a random textbox
        Dim index As Integer = rnd.Next(0, itemList.Count)
        itemList(index).Text = lstListbox.Items(i).ToString
        'Remove the textbox so we can't pick it again
        itemList.RemoveAt(index)
    Next
End Sub
You can write a small routine that dynamically adds each textbox to the list instead of hardcoding them in there, but if you know you'll just want to popullate these 6 you don't have to go to the trouble.
GeneralRe: The randmize function using listboxes Pin
China-Gary21-Feb-07 8:43
China-Gary21-Feb-07 8:43 
Questioncreating connection Pin
Ramin Zarei21-Feb-07 1:51
Ramin Zarei21-Feb-07 1:51 
Questioncreation of log file in the database Pin
cicandre21-Feb-07 1:29
cicandre21-Feb-07 1:29 
AnswerRe: creation of log file in the database Pin
Colin Angus Mackay21-Feb-07 2:22
Colin Angus Mackay21-Feb-07 2:22 
QuestionShutdown a PC Pin
Central_IT21-Feb-07 0:45
Central_IT21-Feb-07 0:45 
AnswerRe: Shutdown a PC Pin
andyharman21-Feb-07 2:41
professionalandyharman21-Feb-07 2:41 
AnswerRe: Shutdown a PC Pin
CircusUgly21-Feb-07 10:47
CircusUgly21-Feb-07 10:47 
Questiondate and time from database to datagrid in vb.net 2003 Pin
kendo1721-Feb-07 0:22
kendo1721-Feb-07 0:22 
AnswerRe: date and time from database to datagrid in vb.net 2003 Pin
Marcus J. Smith21-Feb-07 2:07
professionalMarcus J. Smith21-Feb-07 2:07 
GeneralRe: date and time from database to datagrid in vb.net 2003 Pin
kendo1721-Feb-07 5:43
kendo1721-Feb-07 5:43 
QuestionUpdating Records in datagrid connected thru Adodc. [modified] Pin
Upma20-Feb-07 23:06
Upma20-Feb-07 23:06 
AnswerRe: Updating Records in datagrid connected thru Adodc. Pin
Johan Hakkesteegt22-Feb-07 21:52
Johan Hakkesteegt22-Feb-07 21:52 
Questiondataadapter Pin
sanjiv raj20-Feb-07 23:01
sanjiv raj20-Feb-07 23:01 
AnswerRe: dataadapter Pin
Colin Angus Mackay20-Feb-07 23:18
Colin Angus Mackay20-Feb-07 23:18 
Questionadd library file into VB.NET application Pin
siva50320-Feb-07 22:27
siva50320-Feb-07 22:27 
AnswerRe: add library file into VB.NET application Pin
Colin Angus Mackay20-Feb-07 23:20
Colin Angus Mackay20-Feb-07 23:20 
Questiondisabling local area connection Pin
carl_sti20-Feb-07 22:21
carl_sti20-Feb-07 22:21 

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.