programadorvb6 0 Posted December 19, 2019 Report Share Posted December 19, 2019 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 post Share on other sites
programadorvb6 0 Posted December 21, 2019 Author Report Share Posted December 21, 2019 Resolvido! ______________________________________________________________________________ Que minha coragem seja maior que meu medo e que minha força seja tão grande quanto minha fé. Link to post Share on other sites
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