disable toolstrip on mdi form

I have a mdi form named Mdi parent.
I have a separate registration form that shows a countdown of the date since installation.
What I want is for the toolstrip on the mdiparent form to disable at the expiration date so the user cannot use the program until it's registered.

I have the code on the registration screen. It is supposed to call the mdiparent form.
I know it's a collection but I don't want to call each button and Not sure that it would work either.
Public Class frmRegister

    Private Sub frmregister_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        frmMain.Button1.PerformClick()
         lblCustRef.Text = SL.Reference
        Dim Days_Used As Short


          If Is_Registered() Then
            ExpireLab.Text = "This software is registered"

       '  Insert code to display the program here
            process()
         Else
 Days_Used = Is_Expired()
 If Days_Used = -1 Then
     ExpireLab.Text = "Your 30 Day Trial has Expired.You must register to continue."
     ExpireLab.ForeColor = System.Drawing.Color.Crimson
' HERE is where I want the mdiparent toolstrip to be disabled. I can't seem to get it to work. The mdiparent gets a null reference when I run the code.

  Else
ExpireLab.Text = Str$(Days_Used) & " days of a 30 day trial."
 End If

  On Error GoTo 0
 Exit Sub
    End Sub

    Sub process()

        
        'MdiParent.Enabled = True
     ' MdiParent.Visible = True
       
 Me.Close()
    End Sub

Open in new window

LVL 1
mindserveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

greg wardSystems EngineerCommented:
fMainForm.Toolbar1.Enabled = False
 
Greg
0
ashishgamre11Commented:
Try this:

        MdiParent.Visible = True
        MdiParent.Visible = True
        MdiParent.ToolStrip.Enabled = False
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mindserveAuthor Commented:
I get the error message "Toolstrip is not a member of system windows forms on MdiParent.ToolStrip.enabled=false
  MdiParent.Visible = True
            MdiParent.Visible = True
            MdiParent.ToolStrip.Enabled = False

and for Greg I get the error FMainform is not declared.
fMainForm.Toolbar1.Enabled = False

I have tried MdiParent.ToolStrip.enabled=false and that also produces an error message.

0
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

mindserveAuthor Commented:
Error      1      'ToolStrip' is not a member of 'System.Windows.Forms.Form'.      
I added System.Windows.Forms.Form to the form and still get the error message.
0
ashishgamre11Commented:
       MdiParent.Visible = True
        MdiParent.Visible = True
        MdiParent.ToolStrip.Enabled = False



-------->>>>>> MdiParent.ToolStrip.Enabled = False

Replace 'ToolStrip' by the name of your toolstrip.
0
mindserveAuthor Commented:
Toostrip is the name of the toolstrip...:(
I have tried the following:
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/00c8700a-75e8-4457-ae94-fa2d0b3b19c4

Been looking around the net and it appears that this is an issue.
0
mindserveAuthor Commented:
The code was correct  but I did have some other issues with calling the toolstrip from another form.
0
mindserveAuthor Commented:
Imports System.Windows.Forms.ToolStrip
Imports System.Windows.Forms.Form

Public Class frmRegister
    Inherits System.Windows.Forms.Form

I had to import the forms.toolstrip and then it worked
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.