Set Form Based on CurrentUser/Role


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
In order to do what I wanted to do I utilized the ShowGateway() method in the program.cs.  I added two forms to the collection in InitApplication.  Then I added the following code to the ShowGateway method:

if (System.Environment.MachineName != "COMPNAME")
{
    e.FormIndexToShow = 0;
}
else
{
    e.FormIndexToShow = 1;
}

This does work.  My actual code involves a little more string manipulation in order to limit the number of workstations to three that get FormIndex 1; however, if I logged on to those workstations as myself (an admin), it would be nice to get the general window (index 0).  That won't happen, though.  Only the one form will be displayed. 

So, here is my question:  how do I set the main form based on the current logged in user name or a role assigned to that user?

Thanks,
Bill


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search