Page 1 of 1
System dialogs
Posted: Sun Apr 07, 2013 12:47 am
by farrukhshahzad
How can we use system dialog (like the one appear on max or min value of Analog numeric) in script.
Can we have form designed with vertical scroll bar? I need to enter list of items on the form which may take more space than one screen.
Re: System dialogs
Posted: Sun Apr 07, 2013 4:21 am
by farrukhshahzad
I mean the dialog like in the attached image. Can we access similar dialog via script?
Re: System dialogs
Posted: Mon Apr 08, 2013 1:12 am
by Edmund
Well I haven’t heard or seen anything about it so It´s probably not meant to be used from anything else than the built in functions.
But there is a way to use them anyhow.
Code: Select all
Neo.ApplicationFramework.Tools.Messagebox.MessageBoxFX.Show(System.IntPtr.Zero, "I´m a iX-Message :)");
- Messagebox.png (10.09 KiB) Viewed 13792 times
Code: Select all
Neo.ApplicationFramework.Tools.Messagebox.MessageBoxFX.Show(System.IntPtr.Zero, "I´m another iX-Message :)", "Test Message", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
- Messagebox_2.png (16.15 KiB) Viewed 13792 times
The methods wants a pointer to the owner of the window but I have only set it to zero.
Please note! I have no idea of what problems / error this can cause in your application (because of the lack of documentation), and I have only tested this for PC-targets.
Re: System dialogs
Posted: Mon Apr 08, 2013 2:40 am
by farrukhshahzad
Thanks.
I am trying on T7A target, but getting error that I am missing an assembly..
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;
using System.Windows;
using System.IO;
Re: System dialogs
Posted: Mon Apr 08, 2013 3:10 am
by Edmund
Well that´s because your target is a panel with Windows CE and Compact framework... And WPF is not available there.
There is also a class called MessageBoxCF, have a try at that (I have never tried it).
Why are you not using the "ordinary" message box function i .Net?
Re: System dialogs
Posted: Mon Apr 08, 2013 1:40 pm
by filou
Hi,
I confirm the proposal from Edmund, you can use the MessageBoxCF, like the these example:
// you have to use this directive
using Neo.ApplicationFramework.Tools.Messagebox;
// Dialog with 3.5s timer:
MessageBoxCF DialogBoxLoad = new MessageBoxCF("Text1", "Text2", 3500);
DialogBoxLoad.Show();
- Picture 1.jpeg (8.55 KiB) Viewed 13777 times
or
// Dialog with OK and an Icon:
MessageBoxCF DialogBoxText3Text4 = new MessageBoxCF("xxxxxxxxxxxxxx", "yyyyyyyyyyyyyyyyyyy", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
DialogBoxText3Text4.Show();
- Picture 2.jpeg (20.77 KiB) Viewed 13777 times
Bye
Philippe
Re: System dialogs
Posted: Tue Apr 09, 2013 3:41 am
by farrukhshahzad
Thanks a lot.
Can we have form designed with vertical scroll bar? I need to enter list of items on the form which may take more space than one screen.
Re: System dialogs
Posted: Fri Jul 13, 2018 6:23 am
by kim
Hi
I am interested in using MessageBoxCF (with X2 terminal), but what feature does it allow? Can I have buttons Yes/No + the timer function?
And perhaps a stupid question, but how do I read if operator pressed Yes or No with this message box type?
btw, it seems MessageBoxFX is not available anymore in iX 2.40
Thanx!