Guest User

Untitled

a guest
Jan 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  2. With Me.Button3
  3. IIf(.Width = 123, .Width = 233, .Width = 150)
  4. End With
  5. End Sub
  6.  
  7. With Me.Button3
  8. .Width = IIf(.Width = 123, 233, 150)
  9. End With
  10.  
  11. With Me.Button3
  12. .Width = If(.Width = 123, 233, 150)
  13. End With
  14.  
  15. ' IIf function - not recommended since it is not typesafe and evaluates all arguments.
  16. .Width = IIf(.Width = 123, 233, 150)
  17.  
  18. ' If operator - typesafe and only evaluates arguments as necessary.
  19. .Width = If(.Width = 123, 233, 150)
  20.  
  21. ' If statement - not an expression.
  22. If .Width = 123 Then .Width = 233 Else .Width = 150
  23.  
  24. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  25. Button3.Width = If(Button3.Width = 123, 233, 150)
  26. End Sub
Add Comment
Please, Sign In to add comment