custom messagebox

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
i've been trying to make a messagebox that's customizable IE
font, backcolor and forecolor can be changed

what i've got so far is a control library solution with a public class that has al the properties and a Show method

inside this class is a Private class that's a form, this is the form that will be displayed to the user like the current Messagebox and MsgBox do

the problem is that when i tried to use the custom messagebox in another project to test it (the form's not complete yet mind you, but that's not the problem) i can make an instance of it, but none of the properties or the Show method is displayed

also (due to my lack of understanding on how this stuff works) i also noticed that my messagbox control cant be added to the toolbar (i want it to be a component tray control actually)

here's what i've got so far for clarity, i could use some guidance
also when it's finished this control will be posted on this forum free for everyone to use too
 
Hey brotha, I'm trying to do the same type of messagebox.

However, I've created a class library (.dll) and added a bunch of private methods and private variables for use inside the class. I was trying to reproduce a vb6 dll that kicks up modeless messageboxes...

I have only one "public" show method where the user can add several parameters in the show method and most are optional with default values and it works good.

I'd say basically you have to deside if this should be a dll, control or component. I may have to move my modeless messagebox to a component. Also change your Friends to Public and Why do you have Shared variables? I'd say you don't need this. I'd only use the keyword Share if you are wanting to make a method static (in vb shared). This allows you to add a shared method like Add() to a class where you don't have to instantiate an object to use it.

My messagebox only has one public method so it's easy for the user/programmer to use. I've only been working on this a few days on and off for two weeks now. After I finish it I'll let you know what the final outcome is.

I'd like to have one object for both modeless and modal messageboxes. I have six variations of this messagebox; OKonly, OkCancel, etc... with 1, 2 or 3 buttons... It works good so far but my icons are looking kind of funny blurry (???).

I'm from mi too. Just north of you about 1 hr and 15 minutes.
 
Last edited by a moderator:
Merchand, I use this code to display the msgbox icons, and I don't see them blurry.
VB.NET:
PictureBox1.Image = System.Drawing.SystemIcons.Question.ToBitmap
I also have the SizeMode to Normal, and set the size like this, even though I know they are 32x32 now:
VB.NET:
PictureBox1.Size = PictureBox1.Image.Size
 
Very Good! Another great tip! :D

I had some images that I added to an imagelist and then assigned them as required to my pic control.

This works much better and I'll don't have to add images to source safe either.

Thanks so much!!! I'm cutting my teeth on a .dll and a user control... need less to say I have my hands full. :)
 
Back
Top