Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Login username selected
PostPosted: Wed Apr 18, 2012 5:28 am 

Joined: Wed Apr 18, 2012 5:20 am
Posts: 2

Offline
Hi!

How can I make the username be pre-selected with the username "Administrator"?
Image


 Profile  
 
 Post subject: Re: Login username selected
PostPosted: Wed Apr 18, 2012 7:44 am 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 824

Offline
You can bring up a dialog box that allows only a particular user to login. There is no drop down list of other users. You need to create a button on the screen and then go to the screen's script interface. Then add code to the Button click event. It will look like this when you are done:

Code:
namespace Neo.ApplicationFramework.Generated
{
    using System.Windows.Forms;
    using System;
    using System.Drawing;
    using Neo.ApplicationFramework.Tools;
    using Neo.ApplicationFramework.Common.Graphics.Logic;
    using Neo.ApplicationFramework.Controls;
    using Neo.ApplicationFramework.Interfaces;
   
   
    public partial class Screen1
    {
      
      void Button1_Click(System.Object sender, System.EventArgs e)
      {
         //Opens a login with the 'Administrator' as the username
         Globals.Security.Login("Administrator");
      }
    }
}


Attachment:
Snap 2012-04-18 at 07.43.28.png
Snap 2012-04-18 at 07.43.28.png [ 5.8 KiB | Viewed 3298 times ]

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: Login username selected
PostPosted: Wed Apr 18, 2012 8:33 am 

Joined: Wed Apr 18, 2012 5:20 am
Posts: 2

Offline
Thanks! Worked like a charm! :D
But how do I choose where the login screen pops up? I would like it to be centered on the screen, and not in the top left corner.

//Edited


 Profile  
 
 Post subject: Re: Login username selected
PostPosted: Thu Apr 19, 2012 2:09 pm 

Joined: Tue Mar 13, 2012 9:53 am
Posts: 824

Offline
Hi Kjetilh90,

There must be a bug if the screen keyboard doesn't come up. The harder way is detailed in the attached project called CustomRecipeDialog.zip. You can take a look at that. In the project you can modify where the window shows up as well.

You need to follow the following procedure before opening the application:

1. Create a panel application, import the System.Windows.Forms.TextBox
object
Attachment:
pic21726.gif
pic21726.gif [ 53.4 KiB | Viewed 3275 times ]


2. Close the application
3. Open the CustomRecipeDialog application and build/run.


Attachments:
CustomRecipeDialog.zip [37.28 KiB]
Downloaded 240 times

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: