Is it possible to have a function within a function?
Something like this:
Public Class Form1
Private Sub button1_Click(sender As Object, e As EventAr
It is possible to have a function within a function, called lambda expressions.
In your case, however, it is unclear to me how it can be useful.
It is not possible to have a fully fledged nested function definition in VB.NET. The language does support multi-line lambda expressions which look a lot like nested functions:
Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
Dim anim =
Sub()
Me.Refresh()
...
End Sub
End Sub
There are some notable differences though:
Handles
clause.Implements
or Overrides
.Sub
definition.anim
is actually a delegate and not a function.