Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

This is what I have done so far:

When the user clicks this menu item all the menu items clear and a password prompt comes up. If the password is correct the menu items are added to the box again.

 

That works fine but the problem is that after the password is entered correctly, the user would expect the box to be shown, but I cannot figure out how to do that. I tried using PerformClick() but that did nothing at all.

private void RepairMImain_Select(object sender, System.EventArgs e)
	{
		this.RepairMImain.MenuItems.Clear();
		PassForm P=new PassForm();
		DialogResult R= P.ShowDialog();
		if(R==DialogResult.Yes)
		{
			this.RepairMImain.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
			this.RepairMI,  this.AboutRepairFilesMI,  this.ViewBackupMI,  this.AboutBackupMI});
			
		}
	}

C#
  • *Experts*
Posted

Are you saying that you prompt for a password every time the user clicks on your main menu item? Wouldn't it be MUCH simpler to prompt for a password at some other point (when starting up the main form, for instance). If they don't enter the right password, just don't show the app at all or hide all menus except for Exit or File->Exit.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
  • *Experts*
Posted

We have the same type of program here, but it still seems easier to provide a Log Out/Log In type of function (if you don't want them to have to close/open the program) than to try and ask for a user/pass on every menu click.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

I did that at first but. . .

 

The reason I chose to put the user pass at the point when the user clicks on the main mi is because I do not want a user who does not have the pass to even see the menu items.

C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...