In a module you have declared a Structure or Enum that you will use through out a project.
Module Module1
Public Structure dummy
Dim i As Integer
Dim s As String
End Structure
End Module
But you can't, you will get an error if you declare following in an other Form
Dim fi as dummy; will give an error looking something like this:
Error 6 'fi' cannot expose type 'Module1.dummy' outside the project through class 'Form1'.
Fix:
Declare Module Module1 as Friend Or Public.
Code:
Public Module Module1
Public Structure dummy
Dim i As Integer
Dim s As String
End Structure
End Module
Thursday, May 07, 2009
Saturday, May 02, 2009
VB.Net IsDisposed
I found the simple solution for my VB6 habits.
Open and closing a Form multiple time didn't require any special in VB6,
in VB.Net when you close the Form2 it will be disposed, so check if it IsDisposed
to recreate it. See some coding below
Public Class Form1
Dim frm2 As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If frm2.IsDisposed Then
' Create it again
frm2 = New Form2
End If
frm2.Show()
End Sub
End Class
Open and closing a Form multiple time didn't require any special in VB6,
in VB.Net when you close the Form2 it will be disposed, so check if it IsDisposed
to recreate it. See some coding below
Public Class Form1
Dim frm2 As New Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If frm2.IsDisposed Then
' Create it again
frm2 = New Form2
End If
frm2.Show()
End Sub
End Class
Subscribe to:
Posts (Atom)
MySQL to MariaDB
Here is a good description how to migrate to MariaDb MySQL to MariaDb Example of how to dump data from MySQL port=3307: mysqldump --user=ro...
-
When converting an VB2008 application to VB2010 I run into trouble regarding COM objects while compiling. you get errors like: Error 1...
-
In a module you have declared a Structure or Enum that you will use through out a project. Module Module1 Public Structure dummy ...
-
Apache2 crashes on Ubuntu Linux 22.04.5 after Zabbix was updated to 7.0.26 During a upgrade of my Ubuntu server there was a new package for ...