?
Solved

Make a Floating Window in VS2005 CF Application

Posted on 2006-11-04
5
Medium Priority
?
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
A short article about problems I had with the new location API and permissions in Marshmallow
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 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