Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2006, 02:15 AM
Authorized User
 
Join Date: Oct 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default msgbox location

Hello all,
  can you people help me to change the position(location) of msgbox in vb.net without using any windows API.
           If API is mere solution of this problem,then please tell/provide me that API.



With thanks
rajesh,
India
__________________
Regards,
Rajesh,
India
 
Old December 7th, 2006, 04:43 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I don't even think that APIs are going to help you.

Just off the cuff I thought of two approaches:

1. Get the message box window, and change its location
2. Change the screen size, present the messagebox so that it centers itself, then quickly resize the screen so that that center point is no longer at the center. (This would be a ridiculous way to do things; it's only that it crossed my mind.)

But both of these suffer from the same flaw: you can take no action until that box is closed...

There might be some way I am unfamiliar with, but this is the situation I'm aware of.

You could create your own message box by creating a form that is controlled by a function of your own writing that completely emulates the behavior of a message box, but that takes additional parameters for location and or size. I have seen this suggested to create a message box that writes all message-box calls to a log file. Perhaps looking online along that idea will turn up something useful.

You could make it establish its width based on the content or have a preset width that causes the message to word-wrap. You could have the form's background color something more red for warnings, and so on. (You could even incorporate one or more timers to incorporate flashing of text or icons, or to scroll the message marquee-like, etc.)

All of these capabilities would be controlled by arguments given (optional arguments or an overloaded display method). You would have to write the code to accomplish these, but the point is that you can make a really robust message-box-like capability.

You could have more button possibilities (Yes, No, Cancel, Retry, Abort, Close, Send Report, Don’t Know, or anything else you can think up), or you could have the ability to set the button-face text and the button count along with the message and the form's title.

Wrap all this into a class, and you can instantiate it and call its methods, or make it static, and call the methods from anywhere.
 
Old October 18th, 2007, 07:47 AM
Authorized User
 
Join Date: Oct 2006
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for giving me such valuable suggetion.

With thanks
rajesh,
India





Similar Threads
Thread Thread Starter Forum Replies Last Post
Msgbox rwalker ASP.NET 1.x and 2.0 Application Design 28 March 20th, 2008 01:23 PM
Msgbox Help darrenb Access VBA 2 June 8th, 2007 12:53 AM
msgbox Ramakrishna.G General .NET 3 September 14th, 2004 02:17 AM
help with Msgbox helmekki Excel VBA 2 June 25th, 2004 08:24 AM
msgbox bph Access VBA 2 February 6th, 2004 03:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.