I am a learner using Bot-framework. I am trying to find a way to minimize a prompt dialog for instance one with "Yes" and "No" options. My intention is that when one clicks "Yes", the prompt dialog disappears and also when he clicks "No".I have seen sample bots with the functionality but i just cant figure out how it is implemented. Any help?
Sadly you can't minimize the PromptDialog items once they are clicked.
But instead you can use SuggestedActions which are buttons displayed at the bottom of your window and disappear once they are clicked.
See sample in the documentation: https://learn.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-add-suggested-actions?view=azure-bot-service-3.0
And you can have a look to what it will render here: https://docs.botframework.com/en-us/channel-inspector/channels/WebChat?f=SuggestedActions&e=example1
Related
I am looking for a way to disable 'Preferences' Button in Print Dialog in WPF. What I want is preventing the user from clicking that button and do unnecessary changes to the print.
I want to do it without creating a whole other print dialog on my own. Is there a possible way of accessing those buttons from code behind and manipulate them?
I'm writing a test using C# for our website. When a record is deleted online, a popup dialog box appears that basically asks the user to confirm. Usually I can just inspect an element by right-clicking, but when this dialog box is up, nothing can be selected, in or out of the dialog box. When I tried using the IDE to see how it would handle the dialog popup, it gave this command:
Assert.IsTrue(Regex.IsMatch(CloseAlertAndGetItsText(), "^Are you sure you want to delete this batch[\\s\\S](\n|\r\n)All claims in this batch will be permanently deleted\\.(\n|\r\n)This action cannot be undone\\.$"));
That didn't work, so I also tried:
CloseAlertAndGetItsText();
But that didn't work either.
The box has two buttons, OK and cancel, and the OK button is already highlighted, so if there is a way to just do something like this:
driver.sendKeys(return);
But driver doesn't have a sendKeys command to call on its own.
driver.SwitchTo().Alert().Accept();
That should be able to handle the type of dialog box you're describing. I've been able to use it for any dialog I've had to come across, so it works pretty well. I've also read about using IAlert but since I've never needed to use it, I have no idea how well it works, but if my solution doesn't work for you, maybe look into that.
I m coding in c# and I want to change the default arrangement of 'Save' and 'Cancel' buttons in SaveFileDialog. The default arrangement is that the 'Save' button is above the 'Cancel' button.
What I want is to place 'Cancel' button on the right hand side of the 'Save' button.
I searched over the web and found that the text on these buttons can be changed(to which the answer was on stackoverflow itself) and nothing found on changing their arrangements (locations).
Please give me a solution if any of you have experienced this so far....
thank you
Please don't do this.
The user is used to where these buttons appear. If you try to change their layout then you will just make you app feel wrong.
If you have to do this then should make sure you use the legacy file dialogs (which will make your dialogs look even more odd on Vista/7). Use the lpfnHook field in the OPENFILENAME struct to obtain hooks in to the dialog procedure. Respond to the CDN_INITDONE notification and move the buttons around with MoveWindow or SetWindowPos. You'll have to hunt for the button window handles.
But really, please don't do this, you'll just make your app worse.
That rings a bell. When you have the code to change the text of the button then you have the handle of the button window. Which you can then use when you pinvoke GetWindowRect and MoveWindow to move the button somewhere else. Visit pinvoke.net for the declarations.
Beware that the dialog changed in every Windows version. The next one might well break your program. Your customer is not going to be disappointed when you don't do this.
In my application I have context menu which is associated with tray icon of the application, when user click on About menu item, it display the message box. Message box is still visible, user right click again on tray icon, menu pop up, user click somewhere else than context menu should disappear, but it didn't, it is still displayed.
That's a bug. Probably in Windows, the MSDN Library documentation for TrackPopupMenu documents a very similar problem. I don't see an obvious workaround, other than avoiding using MessageBox. Create a little form to be your About box. Display it with the Show() method.
You could use SendKeys.Send("{ESC}");
in the trigger event when the user clicks somewhere else.
What are the ways to restrict the User to click a button more than once in Windows c# application ? I dont want them to click more than once, which leads to a problem.
Can i change the make the cursor invisible after clicking once or any cother can be done ?
Disable the button on the click event. No more click events will be generated.
(best option) Fix your code so there's no problem.
Disable the button when you get the first click event.