jimmychan Posted July 28, 2006 Posted July 28, 2006 Help Help!!! How to create a customise messagebox for a PocketPC(device) application in vb.net. I am using VS 2005 Quote
teixeira Posted July 28, 2006 Posted July 28, 2006 Hi, Create a new classe that inherits System.Windows.Forms and add the custom behaviors as you want. Regards, Tiago Teixeira Quote
Cags Posted July 28, 2006 Posted July 28, 2006 Doing as teixeira suggests will allow a dialog, but being on the Pocket PC it will be full screen. This might suit your purposes but I suspect you wanted a floating dialog like the actual MessageBox. As for how todo this or if it's infact possible I'm not entirely sure. Quote Anybody looking for a graduate programmer (Midlands, England)?
jimmychan Posted August 1, 2006 Author Posted August 1, 2006 Is there any reference for me to see for the float dialog. :rolleyes: Quote
Cags Posted August 1, 2006 Posted August 1, 2006 To the best of my knowledge there is no managed code solution. As far as I know the only way to achieve a floating dialog is through various API calls to methods such as MoveWindow(). A search on google for something like "floating dialog" "compact framework", should help you find an example. Quote Anybody looking for a graduate programmer (Midlands, England)?
mandelbrot Posted August 1, 2006 Posted August 1, 2006 Alternatively you could inherit from the panel class and dynamically create ontop of your current form - not strictly a dialog, but you'd be able to do pretty much anything with it... Paul. Quote
Cags Posted August 1, 2006 Posted August 1, 2006 This is true and is a method I have employed in the past. The trickiest aspect of doing it this way is making the Panel modal so that the form behind it cannot be clicked untill the dialog is closed. In my case this wasn't too tricky as the entire page worked on GDI and clickable regions, rather than using standard System.Windows.Forms controls. Because of this I could solve this problem by temporarily unhooking the click events of the form. If somebody has a solution for achieving a truly modal panel, I'd certainly be interested to hear their ideas. Quote Anybody looking for a graduate programmer (Midlands, England)?
mandelbrot Posted August 1, 2006 Posted August 1, 2006 One possibility would be to put down two panels - the first having being made transparent. The second, being the dialog, obviously contains the message. I've never tried it, though....... Quote
Cags Posted August 1, 2006 Posted August 1, 2006 It's a nice idea but not actually workable since you cannot have a truly transparent panel. Setting the background colour to Transparent simply makes it's background colour the same as that of it's parent. A cheeky way of doing it might be to take a screenshot of the applications state before creating the dialog. Adding this to a picturebox infront of all other controls, then putting the dialog infront of it. But to the best of my knowledge there is no managed way todo this and as such you'd be better off just looking into using MoveWindow to resize the form. This would remove the modal problem as the Form class has a ShowDialog() method that essentially does it for you. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.