VB Defaults - VS2022

Dewayne Basnett 1,361 Reputation points
2024-06-17T13:04:53.5166667+00:00

My VB defaults in Visual Studio are set to Infer Off, Strict and Explicit On. I create a windows forms app in VS2022. It is .Net 8. The form has a button and a textbox and this code shows no errors and runs.

Code:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox1.Text = 1 / 2
        ' TextBox1.Text  has 0.5
    End Sub
End Class

What? If I declare the options in the form then I get errors. Option Strict On : Option Explicit On : Option Infer Off If I create a Windows Forms App (.Net Framework) then I get the appropriate errors.

How do I report this?

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,642 questions
{count} votes