zephirus Posted October 8, 2009 at 11:40 AM Report Share #290638 Posted October 8, 2009 at 11:40 AM Olá, Como o próprio nome indica, eu quero que o user, ao mudar a largura das colunas de uma listview, não consiga colocá-la com width = 0, ou seja, fazê-la desaparecer. Queria definir um tamanho mínimo. Link to comment Share on other sites More sharing options...
bioshock Posted October 8, 2009 at 11:48 AM Report Share #290640 Posted October 8, 2009 at 11:48 AM Fazes um ciclo while ou mesmo um simples if. Caso a largura das colunas seja diferente de 0 então pode faze-lo, caso contrário aparece uma mensagem "O tamanho mínimo é de 1" ou como tu quiseres. Link to comment Share on other sites More sharing options...
zephirus Posted October 10, 2009 at 03:43 PM Author Report Share #291046 Posted October 10, 2009 at 03:43 PM Fazes um ciclo while ou mesmo um simples if. Caso a largura das colunas seja diferente de 0 então pode faze-lo, caso contrário aparece uma mensagem "O tamanho mínimo é de 1" ou como tu quiseres. Em que evento é que devo colocar esse código while ou if? Link to comment Share on other sites More sharing options...
bioshock Posted October 10, 2009 at 04:55 PM Report Share #291050 Posted October 10, 2009 at 04:55 PM Talvez no evento resize Link to comment Share on other sites More sharing options...
fLaSh_PT Posted October 13, 2009 at 03:58 PM Report Share #291536 Posted October 13, 2009 at 03:58 PM Podes manipular nestes dois eventos: Private Sub ListView1_ColumnWidthChanging(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangingEventArgs) Handles ListView1.ColumnWidthChanging End Sub Private Sub ListView1_ColumnWidthChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangedEventArgs) Handles ListView1.ColumnWidthChanged End Sub O primeiro evento ocurre quando o utilizador esta a alterar o tamanho da coluna e o segundo ocorre no final final da operação.. Podendo ainda no evento ColumnWidthChanging cancelar o evento quando o user tenta fazer o resize.. com o método e.Cancel = True Compr. Making the impossible possible and pwing the world on db at a time. Link to comment Share on other sites More sharing options...
zephirus Posted October 13, 2009 at 04:31 PM Author Report Share #291542 Posted October 13, 2009 at 04:31 PM Podes manipular nestes dois eventos: Private Sub ListView1_ColumnWidthChanging(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangingEventArgs) Handles ListView1.ColumnWidthChanging End Sub Private Sub ListView1_ColumnWidthChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnWidthChangedEventArgs) Handles ListView1.ColumnWidthChanged End Sub O primeiro evento ocurre quando o utilizador esta a alterar o tamanho da coluna e o segundo ocorre no final final da operação.. Podendo ainda no evento ColumnWidthChanging cancelar o evento quando o user tenta fazer o resize.. com o método e.Cancel = True Compr. Obrigado fLaSh_PT. Vou testar. 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