|
We get the following error when we create a new child on our MDI Parent:
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll<br />
<br />
Additional information: Error creating window handle.
The Code:
Dim frmChild As Form = New frmAffiliationRegistration()<br />
<br />
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click<br />
<br />
<br />
frmChild.Dispose()<br />
frmChild = New frmAdjudicatorRegistration()<br />
frmChild.MdiParent = Me<br />
frmChild.Enabled = True<br />
frmChild.Show()<br />
End Sub
Any advice?
|
|
|
|
|
Heya
Change your Dim line to this:
Dim frmChild As New frmAffiliationRegistration()
And take the first two lines out of the next block. You only need these three:
frmChild.MdiParent = Me
frmChild.Enabled = True
frmChild.Show()
Beware the chickens, for in their silence, they plot...
Life is too short to be taken seriously.
-- Oscar Wilde
|
|
|
|
|
Dim frmChild As Form = New frmAffiliationRegistration()
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
frmChild.Dispose()
frmChild= Nothing
frmChild = New frmAdjudicatorRegistration()
frmChild.MdiParent = Me
frmChild.Enabled = True
frmChild.Show()
End Sub
'Is it Working???
|
|
|
|
|
What is the best way to backup a database used in a project to a CD-Writable? We want to put in an option in our VB.NET program to burn the database on a CD.
|
|
|
|
|
Emile Jacobs wrote:
What is the best way to backup a database used in a project to a CD-Writable? We want to put in an option in our VB.NET program to burn the database on a CD.
If you are using only Windows XP based machines, you can use IMAPI, which is a very easy way for VB programmers, because it's avaliable as a bunch of COM components.
But if you want broader OS scope, you'll need to use Nero's APIs.
while (!sorted)
;
|
|
|
|
|
How does one declare a variable that is available for any form in the project?
|
|
|
|
|
Emile Jacobs wrote:
How does one declare a variable that is available for any form in the project?
Declare a shared public variable in your class, access this variable via MyClassName.MyVariableName.
Click here to see my articles and software tools
|
|
|
|
|
We created a shared variable in the class, but we do not know how to declare the class in the different forms!
|
|
|
|
|
The class has to be in the same the project, you don't need to declare it. If the class is only visible in a different name space, then you need to access it via MyNameSpace.MyClassName.MyVariableName.
If multiple threads are accessing this variable, make sure thread-safety.
Click here to see my articles and software tools
|
|
|
|
|
Thanx for the great advice! Everything works perfectly!
|
|
|
|
|
Add a new module, such as modMain.vb and in there declare a variable as Public, i.e:
Public iMyGlobalVariable as Integer
This will give it a global scope.
|
|
|
|
|
create a new class called GlobalVariables or what ever you like
Then put the variables that you would like to call
this is C# code
I created a new Class called GlobalVariables.cs
on that page the only code that I have is
public class GlobalVariables
{
public string ReportSection = "";
public GlobalVariables()
{
}
}
just because I didnt heed it to do anything else.
Now on any page that I like I can do this:
create an instance of that class
GlobalVariables MyVariables = new GlobalVariables();
now assign the values
MyVariables.ReportSection = "";
that should do it,
William O'Malley
|
|
|
|
|
I created a Form having controls more than 500(say) in a Panel all are having anchors set(incl. Panel). When I try to Resize the Form, It takes too much of time to get refreshed. The Form get dull and sluggy for few seconds. Is there anyway by which I kan write a code after resizing event of form gets over? Or boost up the speed of Resizing event. Anchoring is not the solution @ all . Moreover, when I give "Panel1.Controls.Clear", It takes 2 much time to Clear all the Controls from The Panel.
Plz HELP........
RAVI.
|
|
|
|
|
First of all, why would you want to have 500 controls on a form???
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
RAVI143 wrote:
I created a Form having controls more than 500(say) in a Panel
How do you fit everthing inside?? My suggestion is, if it's not all visible at one time, try to add controls dynamically instead of having all the controls at the same time.
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
500 CONTROLS?!
I'd look at that and close the window immediately and the entire app shortly thereafter and write it off as being way to convoluted. How about breaking some of that up into multiple forms.
Coding for every one of these must be a real pain? Even to just get values!
RageInTheMachine9532
|
|
|
|
|
Hello,
I have three forms: frmCustomerTemplate, frmAddCustomer, and frmUpdateCustomer.
frmAddCustomer derives from frmCustomerTemplate, and frmUpdateCustomer derives from frmAddCustomer.
Diagram:
frmCustomerTemplate --> frmAddCustomer --> frmUpdateCustomer
I'm encoutering a problem where frmUpdateCustomer is not getting values from the fields that were defined on frmCustomerTemplate. For example, frmAddCustomer defines a Home Telephone textbox that was not declared on frmCustomerTemplate. When I do an update (using frmUpdateCustomer) I can only get the value from the Home Telephone textbox. All the other fields populate my variables with nulls, even though they are populated. All the controls on frmCustomerTemplate are declared as Protected.
Any ideas why this is happening?
Thanks,
Andrew
|
|
|
|
|
I have an application that calls a webservice and passes
a file to it to process the data. I currently have 1 file
format, and can process the data with no problems.
I would like to create a client that calls a webservice
dependant on the file name.
My question in short is this. Can you dynamically create
a reference to a webservice at runtime?
I assume I will need to modify the client to create a
proxy on the fly depending on file name but not sure if it
is possible.
Thanks in advance
=================================
When i was in school all I wanted was to get out into the real world.
Now that I'm in the real world all I want is to go back to school.
|
|
|
|
|
How do I make a mdiChild forms dock to a parent and auto hide to look like a tool bar (ex. VS.net property window)?
thanks,
Ryan
|
|
|
|
|
It depends how far you wany to go.
Take a look at the following article. It demonstrates how to popup a graphic. You should be able to adopt a similar technique with any form.
MSN Messenger-like popup
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
I had the idea to copy the controls of a panel to a new Form. It works if I use the copyTo method of the control collection of the panel.
The problem is, the controls aren't copied, there moved!? Is this a bug or ...? Anyone an idea?
Test it yourself. On a simple Windows Form with a panel1, a button1 and a textbox1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' rise!
Dim form2 As New Form
Dim c(Panel1.Controls.Count - 1) As Control
Panel1.Controls.CopyTo(c, 0)
form2.Controls.AddRange(c)
form2.Size = Panel1.Size
form2.Show()
End Sub
As you will see, the controls are moved to the new form2, instead of copied there.
|
|
|
|
|
That's because you're only copying the references to the controls, not the actual controls.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Here is the problem I'm having and maybe some VB6 guru may answer and resolve my problem.
I have WinForm Control created in .NET as an ActiveX control and purfectly registered on the system.
It works fine in any container I have: TstCon32, MFC Dialogs, all Office Applications and etc.
Actually, it works fine even inside VB6 when in Design Mode. When I'm running in VB6 Run/Start(F5) or Start with Full Compile (Ctrl+F5) -- it also works fine. So, I'm assuming that everything is fine with my control.
However, when I'm trying to create Project.exe through File/Make Project.exe VB6 starts compiling the program and when about 10% Progress is shown I'm getting an error message box: "Unexpected error".
So, what could be wrong? And how could I find this out?
Thanx
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I am looking one of those funky Outlook type bars. There is one at the resource page, but it is only a demo, and you have to pay a couple of dollars to buy the source code...
|
|
|
|
|
How about Marc Clifton's Outlook Bar[^]?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|