Question Passing information between forms..

PRo-Beaniie

Well-known member
Joined
Mar 17, 2011
Messages
55
Location
Hertford, Hertfordshire, United Kingdom
Programming Experience
3-5
Ok,

I'm getting a little fustrated, ive been trying to figure out how to allow my main from access to a sub form. what I'm initially aiming for is control of text and font color via a dialog on the main form and the results to appear on the second form, if that makes sense. Most of my knowlege resides around using VB.net for creating games and not progams. any help would be greatly appreciated, ill post the code so you guys might be able to get a better understanding of what im looking for as a result.

The Errors I recieve are
(In-accessable due to is protection level)
(Exeption unhandled)

I know vaugly what needs to be done i just need a little nudge getting there.
VB.NET:
<< (this code is located on the primary form) >>
    Private Sub FontButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FontDialog.Click
        'Font Button Controls...'

        Dim Instance As New FontDialog
        Instance.ShowDialog()
        Inputtext.Font = Instance.Font
       [COLOR=#0000ff] Scrolltext.font = Instance.Font[/COLOR] << (Scrolltext is located on the secondary from)
    End Sub

Many thanks Pro Beaniie
 
OK, I have no knowledge of modules but i think im along the right lines, i have built this code but still have one error to content with, is this code correct??

(Error 2 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\PRo-Beaniie\Desktop\Video Narrator V.1.0\Video Narrator V.1.0\Video Narrator V.1.0\Exchange.vb 12 100 Video Narrator V.1.0)


VB.NET:
Module exchange
    Public Instance As New FontDialog
    Public color As New ColorDialog
    Public inputtext As Object
    Public scrolltext As Object
    Public Sub FontButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles[COLOR=#ff0000] FontDialog.Click[/COLOR] << ( ERROR "2")
        'Font Button Controls...'
        Instance.ShowDialog()
        Inputtext.Font = Instance.Font
        Scrolltext.font = Instance.Font
    End Sub
    Public Sub Fontcolor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles [COLOR=#ff0000]Textcolor.Click[/COLOR] << ( ERROR "2")
        'Font Color Button ...'
        color.ShowDialog()
        inputtext.ForeColor = color.Color
        BuildForm.ForeColor = color.Color
        scrolltext.forecolor = color.Color
    End Sub
End Module

is this code correct?? Many Thanks Pro Beaniie.
 

Latest posts

Back
Top