Solved

Make a Floating Window in VS2005 CF Application

Posted on 2006-11-04
5
288 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I think the most popular question in our Windows Mobile Programming zone is about the backlight - we all want to keep it on when our application is running. Few years ago the function SystemIdleTimerReset() did this job. On our side we had to detec…
With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.   If you need to hide the Start Icon and/or the SIP (soft input panel, softwar…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now