Solved

Make a Floating Window in VS2005 CF Application

Posted on 2006-11-04
5
297 Views
Last Modified: 2013-12-27
Hello,

I have a Visual Studio 2005 C# application for the Compact Framework 2.0 and am having trouble making a floating window (form) for a user make selections from.

Here is some “test” code that sets many properties.  When I run the program, no matter what I set, the floating form always shows full screen on the handheld device.

I know this can be done because I’ve seen many CE application have floating windows for selecting stuff (pick lists, etc).

Any help would be appreciated.

Joe

        private void button1_Click(object sender, EventArgs e)
        {
            this.frmSecond = new Form2();
            this.frmSecond.FormBorderStyle = FormBorderStyle.None ;
            this.frmSecond.TopMost = true;
            this.frmSecond.WindowState = FormWindowState.Normal ;
            this.frmSecond.Height = 123;
            this.frmSecond.Width  = 123;
            this.frmSecond.Dock = DockStyle.None;
            this.frmSecond.Anchor = AnchorStyles.None;
            this.frmSecond.ShowDialog();

        }
0
Comment
Question by:jkanisut
  • 2
  • 2
5 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 17875136
set the following properties of the Form to false:

    * ControlBox
    * MinimizeBox
    * MaximizeBox

One other thing you may want to do is center your form on the screen. The following code will center the screen on the device:

Rectangle _screen = Screen.PrimaryScreen.WorkingArea;
this.Location =new Point(((this._screen.Width - this.Width) / 2),
                          ((this._screen.Height - this.Height) / 2));
         
0
 
LVL 1

Author Comment

by:jkanisut
ID: 17903771

This didn't Work.  I'm still getting the second window but it doesn't float... appears maximized.

Any more ideas?  

(By the way, this is a VS2005 Compact Framework 2.0 app running in WM 5.0)

Joe

0
 
LVL 48

Accepted Solution

by:
Mikal613 earned 500 total points
ID: 17903845
0
 
LVL 1

Author Comment

by:jkanisut
ID: 17918310

Thanks.

It appears in that example they simulated a small window using panels, etc.  Cool.

Do you know of some code that would allow the small window to move around based on the location of the mouse?  I tried mousedown, mousemove, etc. but could only read the coordinates within the modal window, not the actual position overall on the whole screen.

Joe
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Account Lockout 12 34
phone mike not working samsung 4 146
Need to understand LG device in hand 7 56
bunnyEars2 challenge 6 148
Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question