Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Tab Index Not Working in Mastercam


Recommended Posts

I have a form that tabs through the fields as expected while debugging. However, when the dll is called within Mastercam it does not work. The only differences in the code are shown below.

 

string strMastercamfile = Path.GetFileName(Mastercam.IO.FileManager.CurrentFileName);

//string strMastercamfile = "22499-PREP.MCX-5";

 

The above code runs in Mastercam. In order for the debug to test the string must be defined. Has anyone seen the Path.GetFilename mess up a Tab Index function?

 

Thanks,

-Pat

Link to comment
Share on other sites

I have a windows form with multiple data entry fields. While debugging I can tab through these fields as expected. Meaning; cursor on the field I want, enter the data, hit tab and the cursor moves to the next field. This is what I expect and how it works in VS debug. However, when the dll is launched in mastercam the tab key does nothing, well that's not true, I get the windows default beep sound. I can use my mouse to get to the next field but I expect it to advance to the next tab index like it does in debug.

 

Thanks,

-Pat

Link to comment
Share on other sites

Well I thought I fixed it.... The ShowDialog() actually closes my form when clicking my Apply button which does not contain a Close() command. I had to switch back to Show() so the button works correctly. I found the thread below discussing I think the same issue but I'm confused because it seems to describe the opposite behavior I am seeing. *Sigh*

 

If anyone has figured this one out please let me know.

 

Thanks,

-Pat

 

 

http://www.emastercam.com/board/index.php?showtopic=57332&hl=showdialog#entry641117

Link to comment
Share on other sites

Well I thought I fixed it.... The ShowDialog() actually closes my form when clicking my Apply button which does not contain a Close() command. I had to switch back to Show() so the button works correctly. I found the thread below discussing I think the same issue but I'm confused because it seems to describe the opposite behavior I am seeing. *Sigh*

 

If anyone has figured this one out please let me know.

 

Thanks,

-Pat

 

 

http://www.emasterca...log#entry641117

 

Would it be possible to get a copy of your project so I can take a look?

Link to comment
Share on other sites

Always use ShowDialog()

 

Your tabstops (if properly set) will work just fine.

And your dialog will not disappear behind Mastercam if you click outside of your dialog, such as on Mastercam itself.

 

Check the properties on your Apply button.

Is there a DialogResult (other than 'None') assigned to it?

That'll cause the dialog to close "even if you don't have a .Close() command."

 

Although setting the DialogResult property will cause your dialog box to close automatically, you can still handle the control's Click event, and the dialog box will close once the event handler's code is finished. While handling the Click event, you may want to halt the closure of the dialog box.

 

You can override the DialogResult property behavior in the Click() event you wish ->

*Or just don't define a DialogResult for your button to begin with!

 

private void btnApply_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.None;
// Now... without a Close(), clicking on this button will not close the Form.
}

Link to comment
Share on other sites

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.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...