Quantcast
Viewing all articles
Browse latest Browse all 27039

VS 2010 Pass value back to MDI form from child from (class)

I have created a Windows Application in which one MDI form (frmMainForm) and several child form.
Application is working fine but Now I want to breake the child forms in a class (.dll) and call them into main project.

In Current project "mainmodule" - I have assign MDI form as
HTML Code:

Public MainForm As New frmMainMenu
frmMainMenu contain the "StatusBar1" for message display

In child form (frmComp) I used to display the text in StatusBar panel like -

HTML Code:

MainForm.StatusBar1.Panels(2).Text = "Saving Record..."
Now I create a class file in which copy "frmComp"
code like -
HTML Code:

    Public gl_strScreenName As String
    Public gl_strUserName As String
    Public MainForm As System.Windows.Forms.Form

        Public Sub New(ByVal ScreenName As String, ByVal UserName As String, ByVal mForm As Form)
        MyBase.New()

        'This  is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent()

    End Sub


But code like earlier show error message "'StatusBar1' is not a member of 'System.Windows.Forms.Form'" -
HTML Code:

MainForm.StatusBar1.Panels(2).Text = "Saving Record..."
Pls guide how to rectify the error and display the message in statusbar panel

Viewing all articles
Browse latest Browse all 27039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>