When i show a message box with "yes", "no" buttons, It shows the message box with Yes button is selected.
But I need to open the message box with "No" button is selected.
Can anyone let me know how to changed the default button at the message box?
.Change the default button at the message box SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Change the default button at the message box
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Change the default button at the message box
Hi,
https://sdkhelp.pdf-xchange.com/view/PXV:UIX_MsgBoxConfig
With nDefautItemID = UIX_No
-žarko
https://sdkhelp.pdf-xchange.com/view/PXV:UIX_MsgBoxConfig
With nDefautItemID = UIX_No
-žarko
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Re: Change the default button at the message box
Thank you for your response. I tried it using below code
public void DialogQuestionYesNo(PXV_Inst inst, int defaultButton, string message, string title, uint wHandle, string header = "")
{
DialogResult result;
int flags = (int)(UIX_MsgBoxStyleFlags.UIX_MsgBox_IconQuestion |
UIX_MsgBoxStyleFlags.UIX_MsgBox_YesNo |
UIX_MsgBoxStyleFlags.UIX_MsgBox_NoWndClose |
UIX_MsgBoxStyleFlags.UIX_MsgBox_AppModal);
UIX_MsgBoxConfig pConfig = new UIX_MsgBoxConfig();
pConfig.nDefautItemID = (int) UIX_MsgBoxResult.UIX_No;
pConfig.nStyle = flags;
pConfig.pTitle = title;
pConfig.pHeader = header;
pConfig.pText = message;
pConfig.hWndParent = wHandle;
int pOptionState = 0;
int pSelectedRadioID = 0;
string ppEditText = "";
// var _dlgRes = inst.ShowMsgBox(message, title, header, wHandle, flags);
var dlgRes = inst.ShowMsgBoxEx(ref pConfig, out pOptionState, out pSelectedRadioID, out ppEditText);
}
This does not display the message box.
Can you please let me know what is missing here?
public void DialogQuestionYesNo(PXV_Inst inst, int defaultButton, string message, string title, uint wHandle, string header = "")
{
DialogResult result;
int flags = (int)(UIX_MsgBoxStyleFlags.UIX_MsgBox_IconQuestion |
UIX_MsgBoxStyleFlags.UIX_MsgBox_YesNo |
UIX_MsgBoxStyleFlags.UIX_MsgBox_NoWndClose |
UIX_MsgBoxStyleFlags.UIX_MsgBox_AppModal);
UIX_MsgBoxConfig pConfig = new UIX_MsgBoxConfig();
pConfig.nDefautItemID = (int) UIX_MsgBoxResult.UIX_No;
pConfig.nStyle = flags;
pConfig.pTitle = title;
pConfig.pHeader = header;
pConfig.pText = message;
pConfig.hWndParent = wHandle;
int pOptionState = 0;
int pSelectedRadioID = 0;
string ppEditText = "";
// var _dlgRes = inst.ShowMsgBox(message, title, header, wHandle, flags);
var dlgRes = inst.ShowMsgBoxEx(ref pConfig, out pOptionState, out pSelectedRadioID, out ppEditText);
}
This does not display the message box.
Can you please let me know what is missing here?
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Change the default button at the message box SOLVED
Hi,
pConfig.nSize = SizeOf(UIX_MsgBoxConfig);
-žarko
pConfig.nSize = SizeOf(UIX_MsgBoxConfig);
-žarko
-
- User
- Posts: 43
- Joined: Fri Jun 24, 2022 8:15 am
Re: Change the default button at the message box
Thank you!, it works as expected
-
- User
- Posts: 1372
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Change the default button at the message box
p.s.
Please mark as "solved".
-žarko
-
- Site Admin
- Posts: 8616
- Joined: Wed Jan 03, 2018 6:52 pm
Change the default button at the message box
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Tracker Software Products (Canada) LTD
+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com