MDIChildred collection and security


Author
Message
Randy Jean
Randy Jean
StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)StrataFrame User (167 reputation)
Group: StrataFrame Users
Posts: 105, Visits: 641
Scenario:

MDI application where in my launchform method I have:





Private Sub LaunchForm(ByVal FormType As System.Type)

'-- Establish Locals



For Each f As Form In Me.MdiChildren

If Not String.IsNullOrEmpty(f.Name) Then

If f.Name.ToUpper = FormType.Name.ToUpper Then

MessageBox.Show("Form """ & f.Text.Trim() & """ already running.")

Exit Sub

End If

End If

Next



Dim loForm As Form



'-- Create the form

Try



loForm = CType(Activator.CreateInstance(FormType), Form)



'-- Set the MDI parent

loForm.MdiParent = Me



'-- Add a handler to the form close

' AddHandler loForm.FormClosed, AddressOf HandlefFormClosed





'-- Show the form

loForm.Show()

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try



End Sub





As we do not want users to be able to launch the same form twice. This works well except when a user does not have access to a form based on the ViewSecurityKey and then another user signs in after a call to SessionLock.LockSession using F11 - this new user may have access to the same form the other user did not, but when they try to launch it it says it's already running because its still in the MDIChildren collection even though it is not visible anymore - So, when a user gets "access denied" what really happens to the form as it doesn't appear to completely get released.



Thanks,

Randy
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Randy Jean - 16 Years Ago
Trent L. Taylor - 16 Years Ago
Randy Jean - 16 Years Ago
Edhy Rijo - 16 Years Ago
Randy Jean - 16 Years Ago
                         [quote][b]Randy Jean (04/17/2008)[/b][hr] So, my other question is:...
Edhy Rijo - 16 Years Ago
                             Thanks Edhy. OK, I figured out how to test the ViewSecurityKey in a...
Randy Jean - 16 Years Ago
                                 It depends on how you have your IDE setup to copy from the code...
Trent L. Taylor - 16 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search