Is there ANY way of creating a non-fullscreen dialog in the CF ??
(yes,yes, I know it's an "official" requirement, but.....)
I just would LOVE to write a dialog based app for my Ipaq that runs in, say,
a 140x80 dialog
thanks in advance to everyone who answers
The solution under eVC++ was simple:
1. set the CDialog::m_bFullScreen member to FALSE (in or OnInitDialog())
2. In WindowProc() return 0 if message==WM_SETTINGCHANGE (avoids that the
dialog is resized to full-screen again when showing/hiding the input panel
even if CDialog::m_bFullScreen was set to FALSE.
.NET Compact Framework:
At the moment I use only one non-full screen dialog in my .NET CF
application. I used p/Invoke to call a function in a MFC eVC++ DLL which
displays the non-full screen dialog for me (as described above)
I hope that there is a better way in future when a new .NET Compact
Framework is released.
Regards,
hfr
"Gerd" <m...@privacy.com> wrote in message
news:#K7jjHXNCHA.1996@tkmsftngp12...
"Gerd" <m...@privacy.com> wrote in message
news:#K7jjHXNCHA.1996@tkmsftngp12...
You can set the size and position of controls and forms(!) using Width,
Height, Left and Bottom properties.
But under the .NET CF this has no affect on forms (but works on controls).
The form is always resized back to full screen. Maybe there is an event to
catch to avoid this.
Regards,
hfr
"James Trefry" <info....@devscapes.com> wrote in message
news:#KySwOYNCHA.2532@tkmsftngp10...
//Change form size so it does not fill entire screen
this.FormBorderStyle = FormBorderStyle.None;
this.Location = new Point(10,30);
this.Size = new Size(220,250);
-James
"hfr" <harald-re...@gmx.at> wrote in message
news:eYRYHSYNCHA.2016@tkmsftngp08...
"hfr" <harald-re...@gmx.at> wrote in message
news:eYRYHSYNCHA.2016@tkmsftngp08...
private void button1_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.PopUpDialog dlg = new
System.Windows.Forms.PopUpDialog();
dlg.Text = "My PopUp Dialog Text";
dlg.ShowDialog();
MessageBox.Show(dlg.DialogResult.ToString());
dlg.Close();
dlg = null;
}
You can simply create a new form that inherits from this one, then easily
add a cancel button, or any other controls that you wish.
If you want an X instead of an OK, just edit the OKButton class.
Nothing prevents the user from clicking on the form behind it though and
canceling the dialog.
Perhaps someone has an idea for that?
Input and constructive criticism is not only welcome, but requested! That's
how we learn.
Thanks,
James Trefry
(see below)
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace System.Windows.Forms
{
/// <summary>
/// Summary description for PopUpDialog.
/// </summary>
public class PopUpDialog : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel pnlTitleBar;
private System.Windows.Forms.Label lblFormTitle;
OKButton ok = new OKButton();
public PopUpDialog()
{
InitializeComponent();
transformPopUp();
}
#region "Implement Popup Dialog Window"
private void transformPopUp()
{
//Change form size so it does not fill entire screen
this.FormBorderStyle = FormBorderStyle.None;
this.Location = new Point(10,30);
this.Size = new Size(220,250);
//Adjust title bar label
pnlTitleBar.Width = this.Width;
lblFormTitle.Font = new Font("Tahoma", 9F, FontStyle.Bold);
lblFormTitle.ForeColor = Color.White;
//Add the ok button
ok.Location = new Point(pnlTitleBar.Width - 22, 4);
ok.Click += new System.EventHandler(this.ok_Click);
pnlTitleBar.Controls.Add(ok);
ok.BringToFront();
}
private void ok_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.OK;
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
pe.Graphics.DrawRectangle(new Pen(Color.Black), 0,0,this.Width - 1,
this.Height - 1);
}
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
lblFormTitle.Text = value;
}
}
#endregion
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pnlTitleBar = new System.Windows.Forms.Panel();
this.lblFormTitle = new System.Windows.Forms.Label();
//
// pnlTitleBar
//
this.pnlTitleBar.BackColor = System.Drawing.Color.DarkBlue;
this.pnlTitleBar.Controls.Add(this.lblFormTitle);
this.pnlTitleBar.Size = new System.Drawing.Size(241, 26);
//
// lblFormTitle
//
this.lblFormTitle.Location = new System.Drawing.Point(4, 6);
this.lblFormTitle.Size = new System.Drawing.Size(135, 17);
this.lblFormTitle.Text = "Pop Up Dialog";
//
// PopUpDialog
//
this.ClientSize = new System.Drawing.Size(240, 295);
this.Controls.Add(this.pnlTitleBar);
}
#endregion
}
public class OKButton: Control
{
private bool isPressed = false;
public OKButton()
{
this.Size = new Size(17,17);
this.Font = new Font("Arial", 9F, FontStyle.Regular);
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
this.BackColor = Color.DarkBlue;
if (isPressed)
{
pe.Graphics.DrawString("ok", new Font("Tahoma", 9F,FontStyle.Bold),new
SolidBrush(Color.White),1,1);
}
else
{
pe.Graphics.FillEllipse(new SolidBrush(Color.White),0,0,base.Width - 1,
base.Height - 1);
pe.Graphics.DrawString("ok", new Font("Tahoma", 9F,FontStyle.Bold),new
SolidBrush(Color.DarkBlue),1,1);
}
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
isPressed = true;
this.Refresh();
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
isPressed = false;
this.Refresh();
}
}
}
"Dannie Johnson" <DanJo...@yahoo.com> wrote in message
news:uryoI$YNCHA.2472@tkmsftngp12...
-Chris
"Dannie Johnson" <DanJo...@yahoo.com> wrote in message
news:uryoI$YNCHA.2472@tkmsftngp12...
Source:
ms-help://MS.VSCC/MS.MSDNVS/ms.embeddedtoolssdk/evtuv/html/etconwindowsdialo
gboxes.htm
That's all I know about it.
-James
"Chris Tacke, eMVP" <cta...@innovativedss.com> wrote in message
news:O287TobNCHA.1724@tkmsftngp10...
"James Trefry" <info....@devscapes.com> wrote in message
news:eSCxq2YNCHA.2472@tkmsftngp12...
Has anyone had similar problems?
I think I will refrain from using non-fullscreen forms for now, then see how
the RTM behaves.
I originally wanted something like a context menu to pop up at certain areas
of my screen, but with any controls I desire on it - not just menus.
Instead of a form I decided to inherit from Control and change the Visible
and Location properties as needed. This solution was not as clean though
and it lacks designer support.
Thanks,
-James
"hfr" <harald-re...@gmx.at> wrote in message
news:es8STchNCHA.1636@tkmsftngp12...
Its just a generic dialog for input a single value: ShowInputDialog(LPCTSTR
lpTitle, LPCTSTR lpLabel, LPCTSTR lpValue, ...);
Another question: Are you satisfied with your XScale device? I am thinking
about to by the Fujitsu Siemens LOOX Pocket PC with an 400Mhz XScale CPU.
Best Regards,
hfr
PS: designer support for controls written for .NET Compact Framework!? I
thougt that this is not supported yet.
"James Trefry" <info....@devscapes.com> wrote in message
news:ehRcdPlNCHA.2680@tkmsftngp13...
"hfr" <harald-re...@gmx.at> wrote in message
news:#xt4wRnNCHA.1280@tkmsftngp13...
> So its good that I still use my non-fullscreen dialog written in eVC++ 3.0
> and call it from my .NET CF application via P/Invoke ;-) (what shall C#
> programmers do without interop and P/Invoke....;-)....)
Agreed. On both points.
> Its just a generic dialog for input a single value:
ShowInputDialog(LPCTSTR
> lpTitle, LPCTSTR lpLabel, LPCTSTR lpValue, ...);
>
> Another question: Are you satisfied with your XScale device? I am thinking
> about to by the Fujitsu Siemens LOOX Pocket PC with an 400Mhz XScale CPU.
I am testing with the Toshiba e740. I like everything about it except it
can't read text files. I posted earlier about the streamreader returning
junk. I kind of need that functionality for creating adhoc html files, then
opening them with PIE. I am rather emotionally attached to this device
though, so I am searching for another way to accomplish the same task
without adding additional dlls to my project. If you have an idea, it would
be much appreciated.
> Best Regards,
> hfr
>
> PS: designer support for controls written for .NET Compact Framework!? I
> thougt that this is not supported yet.
No, it's not supported, which is the major drawback of using a control
instead of a form.
Thanks,
-James
"Gerd" <m...@privacy.com> wrote in message
news:#K7jjHXNCHA.1996@tkmsftngp12...