473,545 Members | 1,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loading the Form by passing form name as string and setting its MDIParent as true

4 New Member
Hi guys,anyone can help me...

I have to set a form's mdiparent property at run time..But I have the formname as string..how can I do it..

I tried this way ..

'Dim _form As Form = CType(Microsoft .VisualBasic.In teraction.CallB yName(My.Forms, formname, CallType.Get), Form)
If (Me.IsMdiContai ner) Then
_form.MdiParent = Me
End If

_form.Show()

But it is not loading the form..

I tried another method as follows..


Dim infAssembly As [Assembly] = infAssembly.Loa dFrom("D:\Vb200 5\Zaky\zaky\bin \Release\Zaky.e xe")

Dim infType As Type = infAssembly.Get Type("formname" , True, True)

Dim method As MethodInfo
'Dim instance As Form = CType(Activator .CreateInstance (infType), Form)
Dim instance As Object = CType(Activator .CreateInstance (infType), Form)
instance.infPar ameters = ""

If (Me.IsMdiContai ner) And (instance.FormB orderStyle <> FormBorderStyle .FixedDialog) Then
method = infType.GetMeth od("Show", New Type() {})
instance.MdiPar ent = Me
method.Invoke(i nstance, New Object() {})
Else
method = infType.GetMeth od("Show", New Type() {GetType(Form)} ) '{Type.GetType( Form)})
method.Invoke(i nstance, New Object() {Me})
End If

But it gives the error message on second line as follows..

Could not load type 'frmTimeSheet' from assembly 'Zaky1, Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null'.

here I am trying to load the form 'frmTimesheet'. before loading it ,
I have to set it's property mdiparent to true.I am calling this from MenuForm which is it's MDIParentContai ner.

Please help me..
Regards
Zak.
May 31 '07 #1
0 994

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2619
by: ColinWard | last post by:
Hi. I have a form which has as its recordsource an SQL string. The SQL String is as follows: SELECT * from CONTACTS where false. this ensures that there is no data loaded in the form when the form is opened. After the user selects the contact from an unbound combobox I want the form to be rebound to its recordsource. I tried using...
4
1840
by: Ahmet | last post by:
Hi all; I have one application in which I read form names from database to be opened. I open form with the code below, and call its show method for form to be shown but before this, I must set MdiChild property to true to make this form child I can call functions as you can see like (show), how can i set.MdiParent = this property of...
1
359
by: Jim Heimer | last post by:
How can I pass data from one child form to another? I have two forms, one (formX) that holds a datagrid (with the results of a query) and another (formY) that consists of many textboxes. I'd like to pass, for example, a row from formX to the textboxes of FormY. In this case, since both child forms are already loaded (both forms are loaded when...
7
4733
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException and is defined in an assembly common to the client and server components. The custom class merely defines three (3) constructors -- the null...
2
1506
by: Supra | last post by:
An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll Additional information: Object reference not set to an instance of an object. i don't know how to reference from frmStatus to this class... Option Explicit On Option Strict Off Imports System Imports System.IO
2
3669
by: Itar | last post by:
I'm having a problem when opening an MDI Child form. I'm declaring the child form then setting the dock property to fill so that it takes up the entire space of the MDI Parent window without being maximized (user request). The problem is that when the child form is being displayed it is briefly shown in it's default size before being resized...
1
2382
by: Michael | last post by:
Hi Everyone, I seem to be having a problem accessing a menuitem on the MDIParent from a child form. From a login (frmSecurity -child form) screen, I need to hide a menuitem based on the users role. The problem is that I can't seem to get access to the menuitem. I can't get it with code like: MDIParent.mnuAdministrator.Visible = true...
5
5602
by: Charlie Brown | last post by:
I am using the following to load my mdi form into the parent. If Me.frmIncoming Is Nothing Then Me.frmIncoming = New IncomingForm Me.frmIncoming.MdiParent = Me End If Me.frmIncoming.Show() Me.frmIncoming.Location = New Point(10, 450) When the forms Show() method is called and before the location is
7
1696
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the tab control that filters the form for me.
0
7478
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7410
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7668
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7437
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5984
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1025
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.