Solved

Make a Floating Window in VS2005 CF Application

Posted on 2006-11-04
5
307 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 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article shows how to setup the internet connectivity on Windows Mobile Emulator.   I assume that you already have Microsoft Visual Studio, Microsoft Windows Mobile SDK's and the emulator installed. The emulator is available with Visual Studi…
Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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