programadorvb6 Posted December 19, 2019 at 01:27 PM Report Share #616894 Posted December 19, 2019 at 01:27 PM Olá boa tarde , fiz um pequeno programa em que tenho de separar os números pelo carácter (-) na minha ListBox ao sortear gostaria que fica-se assim : ex 1 - 12 - 14 - 20 - 32. Junto anexo o código. Desde já agradeço a vossa atenção. Imports System.Collections.Generic Imports System.Linq Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim quantosNumerosNalista As Integer = 20 Dim de As Integer = 1 Dim ate As Integer = 101 Dim result = Enumerable.Range(de, ate).OrderBy(Function(g) Guid.NewGuid()).Take(quantosNumerosNalista).OrderBy(Function(o) o).ToList() For Each num As Integer In result Listagem.Items.Add(num) Next End Sub End Class ______________________________________________________________________________ Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé. Link to comment Share on other sites More sharing options...
programadorvb6 Posted December 21, 2019 at 12:02 PM Author Report Share #616906 Posted December 21, 2019 at 12:02 PM Resolvido! ______________________________________________________________________________ Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now