473,379 Members | 2,132 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

creating a custom Message Box

Hi

I want to create a Custom Message box where the label and buttons have variable text in them.
I need to run a subroutine that calls the message box and if the answer is yes does 1 thing and if it's no it does nothing.
The problem is I can't get the subroutine to wait for the answer from the other form.
Can someone guide me as to how to load the form get the result and feed the result back to the main form subroutine.
By the way the Message Form as txtlabels and commandbutton labels defined as variables which work fine.

Frank
Jan 16 '07 #1
5 5811
I thought I would add this to make sense of my question.

Form1
Subroutine sets the caption for the message form i.e. "Are you sure"
Sets the name on the buttons for the message form i.e. "Yes" or "No"

The problem is when I press the "No" button on the Message form I want to return to the subroutine that called the message form and use the answer to carry on in the first form

I hope this makes some sense.

Frank
Jan 16 '07 #2
I have found the solution using the CallByName function.
Jan 16 '07 #3
Killer42
8,435 Expert 8TB
I have found the solution using the CallByName function.
I'm not familiar with CallByName, but had I read your question earlier I would have said to show the message form modally. In other words (VB6 code)...
Expand|Select|Wrap|Line Numbers
  1. MessageForm.Show vbModal
This doesn't allow control to return until the form is closed (or hidden, I think).
Jan 16 '07 #4
Thanks for you note I might need it latter on in the project. I wanted to go back to the same sub because I was creating a variable which had the name of a procedure. In other words if the answer was yes the variable would have the name of procedure 1 and if no the variable would have the procedure name 2. As I needed to have a lot of these Message Boxes for a lot of different procedures I didn't want to use loads of Message Box forms. Instead I was able to set the name of the procedure in a variable call the message box form call a result procedure in the orginal form and with the CallByName procedure able to call the next procedure using a variable instead of the specific procedure name. CallByName works like this
CallByName object where the procedure is, variable containing name of the procedure, vbMethod
I hope this helps someone else.

Frank
Jan 17 '07 #5
Killer42
8,435 Expert 8TB
Thanks for that, Frank.

Glad to hear you resolved your problem. And yes, hopefully this will be a useful addition to the great storehouse of information here at TheScripts. (I know I'll be filing away the CallByName to have a look at when I find the time.:))
Jan 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: T | last post by:
I have a web site i want to deploy using a VS.NEt set up project. I have no problems with that, that is fine and works no problem. But the web application uses a custom event log to log...
4
by: NutJob | last post by:
Hello, I'm faced with the following problem: I have a (secondary) thread that monitors a socket for incoming message traffic using the select.select() function. Besides that I also have the...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
0
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
3
by: clsmith66 | last post by:
I hope this is just something stupid I'm missing and someone can easily point out my error. I'm trying to do a few turorials on windows services, and the couple I found so far just create an event...
17
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
3
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi all, We have a N-Tier framework and we now create a Web Site App to wotk with this architecture. I add reference from my libraries in the project and creating page and controls is very...
1
by: =?Utf-8?B?QXJ0aHVyIFBhcmtlcg==?= | last post by:
I have been looking for information on creating new custom calendars; not the control, but the class that manages dates and date calculations. The only thing I've been able to find in any of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.