PC Review


Reply
Thread Tools Rate Thread

Access parent form (protected friend/friend) variable in child form

 
 
Chad
Guest
Posts: n/a
 
      14th Apr 2005
Hey everyone,

Ok, I am very security consious with my application(s). I am currently
working on an application in which I want to create several "global"
variables available ONLY to my application, some will contain string values,
some will contain data sets. How can I do this (code or a link to working
code would be great!)

Here's the basic outline:

Parent Form:

Public Class frmMain
Inherits System.Windows.Forms.Form
Friend UserBaseRegPath As String
Private Sub Main_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
UserBaseRegPath = "SOFTWARE\\Chad\\MyApplicationTitle"
End Sub
End Class

Child Form:

Module MruListModule
Private m_Form1 As New Form1
Public Property Form1Ref() As Form1
Get
Return m_Form1
End Get
Set(ByVal Value As Form1)
m_Form1 = Value
End Set
End Property
Public Class ChildForm1
Inherits System.Windows.Forms.Form
Private Sub frmChildForm1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
MessageBox.Show("User Path: " & Form1Ref.UserBaseRegPath)
End Sub
End Module

Thanks!

Chad


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th Apr 2005
"Chad" <(E-Mail Removed)> schrieb:
> UserBaseRegPath = "SOFTWARE\\Chad\\MyApplicationTitle"


This won't solve your problem, but it will correct a bug in your code:
Replace the double backslashes with single backslashes in the registry paths
above.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using form entry fields to email a friend =?Utf-8?B?U3BvcnRtYW43QG5ldHplcm8ubmV0Lk5PX1NQQU1f Microsoft Frontpage 1 6th Sep 2006 06:27 PM
How to access a variable from mdi form to child form Gomathi Microsoft Dot NET Framework Forms 1 22nd Sep 2005 01:27 PM
Accessing parent form variable from child form Ladislav Soukup Microsoft C# .NET 3 27th Jul 2005 03:31 PM
RE: MDI Parent Toolbar access in Child form =?Utf-8?B?R3JrRW5naW5lZXI=?= Microsoft Dot NET Framework Forms 0 21st Apr 2005 07:16 PM
'Friend' vs. 'Protected Friend' K. Shier Microsoft VB .NET 3 3rd Oct 2003 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:40 PM.