Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to move parent form pointer change size,son form cha
Message
From
10/05/2011 07:26:59
 
 
To
10/05/2011 07:11:26
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01510136
Message ID:
01510140
Views:
36
>thank you your reply first ...but sorry,i don't know how to use........
>
>i copy you a part of code, think try it , but i can;t use..... it display error in Me.SizeChanged, this event can't direct to use
>call me use RaiseEvent?
>
>
>Private ChildForm As Form
>
>Private Sub CandidateToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CandidateToolStripMenuItem1.Click
>
>        ChildForm = New personalInformation()
>        ChildForm.MdiParent = Me
>        ChildForm.Show()
>        Me.SizeChanged += New EventHandler(AddressOf MainForm_SizeChanged)
>
>    End Sub
>
> Private Sub MainForm_SizeChanged(ByVal sender As Object, ByVal e As EventArgs)
>        Dim f As Form = DirectCast(sender, Form)
>        ChildForm.Width = f.Width / 2
>        ChildForm.Height = f.Height / 2
>        'Or whatever
>    End Sub
>
>
Sorry, I relied on a C# converter without looking properly at the generated code. Try this:
Private ChildForm As Form
Private Sub CandidateToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CandidateToolStripMenuItem1.Click

        ChildForm = New personalInformation()
        ChildForm.MdiParent = Me
        ChildForm.Show()
    End Sub

  Private Sub MainForm_SizeChanged(sender As Object, e As EventArgs) Handles Me.SizeChanged
        Dim f As Form = DirectCast(sender, Form)
        ChildForm.Width = CInt(f.Width / 2)
        ChildForm.Height = CInt(f.Height / 2)
        'Or whatever
    End Sub
UPDATE: You will need to check that ChildForm exists in MainForm_SizeChanged()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform