A Tale Of Two Forms

Chapter 1: Dedic(lar)ation

This is a story of two forms. The forms themselves are different but in many ways the same.
The form on the west and the form on the east, sharing similarities, but they differ to the core.

The forms are both built upon the foundation of System.Windows.Forms, as all great forms are built.
But having different property settings sets them apart, yet they continue to thrive more and more.

The western form that shines so beautifully against the fastly rising sun is none other than Illoryt.
Its tender sparkles of Color.PeachPuff overtake the typical backcolor of the buttons to their core.

The functionality of Illoryt, the form to the west, remains mostly shrouded in mystery...
Because the programmer has not yet established their behavior, nor of what they will be used for.

The eastern form that sees the final moments of the sun ebbing over the horizon
This, of course, is Agdrazek, the form of metallic wonder, and a sight for those with eyesore.

While Agdrazek wears its coat of Color.LightSteelBlue, Illoryt tans itself against the rays of Color.PeachPuff
And buttons upon Illoryt are fixed at even 3, while the buttons of Agdrazek hold their count at the four.
&

Chapter 2: The Show

So, along comes an empty class full of spirit and potential, and willing to sacrifice.
Its time will be used decently as the Sub Main for this lovely project, hosting the forms of two.

    Public Shared Sub Main()
        Dim F1 As Illoryt
        Dim F2 As Agdrazek
        F1 = New Illoryt
        F2 = New Agdrazek
        F1.Show()
        F2.Show()
    End Sub
, the empty class says, in hopes that both forms will appear.
But, sadly, the forms only made a quick cameo and promptly closed, like a diva at a petting zoo.

    Public Shared Sub Main()
        Dim F1 As Illoryt
        Dim F2 As Agdrazek
        F1 = New Illoryt
        F2 = New Agdrazek
        F1.ShowDialog()
        F2.ShowDialog()
    End Sub
, proclaimed the empty class, in hopes that two forms are manifested.
Depressingly, the forms showed up one at a time, and never was seen in tandem the two.

The empty class became discouraged, wondering why it was difficult to show two forms at once.
It then decided to force itself to run more than it should by running a loop with Do.

    Public Shared Sub Main()
        Dim F1 As Illoryt
        Dim F2 As Agdrazek
        F1 = New Illoryt
        F2 = New Agdrazek
        F1.Show()
        F2.Show()
        Do Until F1.IsDisposed() AndAlso F2.IsDisposed()
        Loop
    End Sub
, the empty class nervously announced to VS 2003.
But there the forms remained as if they froze themselves in time without a hot tub to get into.

    Public Shared Sub Main()
        Dim F1 As Illoryt
        Dim F2 As Agdrazek
        F1 = New Illoryt
        F2 = New Agdrazek
        F1.Show()
        F2.Show()
        Do Until F1.IsDisposed() AndAlso F2.IsDisposed()
            Application.DoEvents()
            Threading.Thread.Sleep(0)  'So that CPU usage doesn't go through the roof.
        Loop
    End Sub
, exclaimed with gusto by the worn and weary class.
And sitting there upon the screen were the two forms of differing background staring back at you.


Chapter 3: Magnetism

The forms of two, Illoryt and Agdrazek, float decently in the space that Windows allows
But, the buttons of Illoryt caused uproar because Agdrazek was always in front and not aside.

So, the class of former emptiness declared a coding statement that would the bring the forms adjacent.
By placing the two forms in such a way that neither would be underneath the other but connected at their side.

        F1.Show()
        F2.Show()
        F2.Left = F1.Left + F1.Width
        F2.Top = F1.Top
, declared the administrative class to the forms of which it owned.
And suddenly, with wink and nod, the form of Agdrazek was taken gently upon the Illoryt's form side.

The buttons of Agdrazek raised commotion on the grounds of being shown and then being moved.
The administrative class promptly WHUPPED THEIR HEADS and told them not to act so snide.


Chapter 4: Button Flirting

At this very point in time, the buttons placed on Illoryt were lonely in their mind.
So they wanted to be recognized by the forms on Agdrazek by contacting them somehow.

The forms of Illoryt and Agdrazek approved this concept, but did remain confused.
"We would need the permission of the administrative class in order for us to do this now."

The administrative class then gave the forms a piece of its mind: "You both will need a reference".
"I'll give each of you a reference to the other form, so that you can communicate now.

The forms went to their work declaring references to the other with excitement in their hearts.
Illoryt proclaimed "Public Aggy As Agdrazek" as Agdrazek agreed on "Public Illy As Illoryt" though both still wondered how.

The buttons worked fastidiously to work with their new reference to access the other form.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Aggy.Button1.Text = "Hi, young single button from Illoryt."
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Aggy.Button2.Text = "Hey, call me."
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Aggy.Button3.Text = "A ""What's up"" from Illoryt."
    End Sub
on the west side and
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Illy.Button1.Text = "Hey there, foxy button."
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Illy.Button2.Text = "I miss u."
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Illy.Button3.Text = "Let's meet tonight."
    End Sub
on the east, the forms were ready now.

        F1 = New Illoryt
        F2 = New Agdrazek
        F1.Aggy = F2
        F2.Illy = F1
, proclaimed the administrative class, bringing references to all forms.
Each form was able to access each other's buttons, texts, and only if they added them, the form cow.