Ok i have a button on MDI parent form and i need to disable it when closing a child form. When writing the button name (cmdmenu) in the child form, it says that the cmdmenu is not declared please help

That button should be publicaly decalred.
if it is publically availabele then
in child form closing event

Mdiform.cmdmenu.disabled=true

how to declare a button in module

Got it i solved it
Here's the code

Dim par As frmMainmenu = Me.MdiParent
        par.cmdmenu.Enabled = False

no need to declare it in module, it works great

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.