Solved

Make a Floating Window in VS2005 CF Application

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

11 Experts available now in Live!

Get 1:1 Help Now