Login username selected

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Kjetilh90
Posts: 2
Joined: Wed Apr 18, 2012 5:20 am

Login username selected

Post by Kjetilh90 »

Hi!

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

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

Re: Login username selected

Post by mark.monroe »

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: Select all

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");
		}
    }
}
Snap 2012-04-18 at 07.43.28.png
Snap 2012-04-18 at 07.43.28.png (5.8 KiB) Viewed 8425 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

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

Re: Login username selected

Post by Kjetilh90 »

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

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

Re: Login username selected

Post by mark.monroe »

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
pic21726.gif
pic21726.gif (53.4 KiB) Viewed 8402 times
2. Close the application
3. Open the CustomRecipeDialog application and build/run.
Attachments
CustomRecipeDialog.zip
(37.28 KiB) Downloaded 721 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply