Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Dialog Boxes


If you click on tools, internet options, you get this really nice dialog box with tabs on it. Would that be a form in visual basic, or can I use a dialog box for that? Not really sure how to start =/




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dialog Boxes
In an attempt to save time, and i'm not asking for peoples personal libraries or anything, i'm perfectly happy to code the solultion myself if that is the case, I thought I would ask.

Since ive discovered the existance of the commondialog object - I was wondering, is there somthing a little more flexible then just msgbox? What I need is two other types, one with a textbox in the middle that I can multiline and just dump a text file into, and another pretty much identicle to msgbox but with a "Do not display this message again" checkbox.

Does such a library exist? Or should I just make them myself - Ive acualy already made the one with the textbox - i'm hoping that since the other one seems so standard I might be able to save myself the trouble.

Thanks in advance,
- Cyril

More About Dialog Boxes
Alright, got the tabbed dialog box =) Now, when I use the open dialog box, thats cool and everything, but I need folders only, no filters etc. Do I need a special API for that?

The reason for this, is I want the user to specify a folder, or click a button to point the program to the folder he/she wants.

Thanks in advance, AGAIN! You guys are great!

Dialog Boxes
I have a question about hooking a Common Dialog box.

I have been able to catch the WM_INITDIALOG message and adjust the size of the dialog box, manipulate the controls, whatever. My question is this...

Is it possible to add controls to a common dialog box once I have hooked the WM_INITDIALOG message? Or perhaps another message to be looking for?

The answer may be no, and that is cool, at least then I would know that I was trying something impossible and I could just get started on creating one from scratch.

Any help pointing me in the right direction would be appreciated!

Thanks in advance...

Dialog Boxes
I am trying to do some basic stuff in vb in excel. Any help is appreciated.

If i create a dialog box as a separate sheet, how do i activate the dialog box from a command button vs. creating a dialog box

What is the real difference between dialog box and userform?

Also, if i want to have a message box activated by a command button, i understand how to initiate it, but if i want the message box to have about 10 lines of text, with each line saying "xxx", "yyy" or "zzz", followed by information filled in from a cell...how do i do this.
ex.

PART A $2,000
PART B $3,000
PART C $4000
PART D $5000

where "PARTA" is fixed verbage, but the money is pulled from a cell.

Thanks in advance.

-Mel

Dialog Boxes
If i need a macro to run in word .. or give my macro its own menu option how can i go bout it. I need a brief example

Help On Dialog Boxes
Hi,
I 've written the English version of my application and now I want to write the Spanish version. But I have problems with Dialog boxes and run-time error messages. I don't know how can I change the language of those MS Windows stuff from English to Spanish.
someone said if I add the international code to my application it will change everything automaticly. but what is the international code?
also someone said I need to buy the Spanish version of VB. but I believe there is easier way too.
any ideas? thanks for any help

Dialog Boxes
I have been trying to figure this out, but have failed. I want to make an event so when the user clicks a command button, an OPEN DIALOG BOX OPENS. I have figured how to do that. But what i want to know is how do I filter the types of files that appear in the Open Dialog Box? Lets say I want the types of files to appear are .mp3, .rm, .au, and .wav. I understand how to filter one type, but what if i wanted all those other file types too?

This is my code currently:
(The cdbOpen is the common dialog box control)

-------------START OF CODE---------------
Dim strFilePath As String

cdbOpen.DialogTitle = "Open File"
cdbOpen.Filter = "*.mp3"
cdbOpen.FileName = "*.mp3"
cdbOpen.ShowOpen

strFilePath = cdbOpen.FileName
-------------END OF CODE------------------


Please Help!! Please also modify this code and tell me, or if this code isn't right, then write another other please. I will appreciate it, thanks in advance.

Dialog Boxes With VB ?
Hi everyone, how can we create dialog box in the latest MSVS ?

Common Dialog Boxes
Is there a better alternative to Common Dialog Boxes? AKA, ones that do not require VB6 installed?

Run... && Find Dialog Boxes
Anyone know how to bring up the 'Run' dialog box (eg Start->Run) or the 'Find' Dialog box from vb code?

thanks for any help

Moving Dialog Boxes
Hi,
Is there any method to set the locations of the Dialog boxex ?

We can give the location of the "Windows", "Forms" by using Move or MoveWindow(API) methods. Like that can we locate the "Dialog" boxs...?
I think this can do bcos Microsoft applications has this kind of Dialog boxes and they are showing in correct locations of the screen

How can i do this...? Pls help me find out

Getting Handles Of Other Dialog Boxes
Ok. Heres my prob. Every time a user "NET SEND"s me a message, I want to grab the text out of the "MESSENGER SERVICE" window and close it. I know you can get hooks or handles on other application windows, but nothings getting me even a hook on this dialog window, let alone capturing the text and closing it. Somebody.. Hellllllpppppppppp.......................

Common Dialog Boxes? Plz Help!!!
i just done making common dialog box which can show: open and save dialog boxes, i just want to ask how will the command button of the 'save' and 'open' will disable first in dialog boxes and when i click one file name from list box, it will enable? is there any flags i'll put or none? tnx !!

Common Dialog Boxes
How do you use common dialog boxes
things like
changing the title
changing the filetypes
changing the default filetypes

and all of the other main uses of it

i understand what it does but i dont know how to use it

Common Dialog Boxes
i have a common dialog control on my form but it has no propertys except custom but when i change things there nothing happens

SOOO frustrated

Forgetting Something About Dialog Boxes..
Simple code to open a dialog box to choose a color, but something's not working. I can't remember what I did the first time that got it to work..


VB Code:
Private Sub Form_Load()     Dim color As Long     dlgColor.ShowColor    color = dlgColor.color End Sub


Any pointers? I get a "Method or data member not found"... I'm assuming that's a component that I haven't checked off?

All The Stupid Dialog Boxes
anyone know a place, control or something that has all the "overwrite" and "prompt save" kind dialogs? or maybe even has a whole file system with the open, save, save as, and new kinda things!! plz help, im desperate!

Common Dialog Boxes
Im using a common Dialog box to open a file, I wish to display the file name and path, how do I do this.

CDL1.filetitle only gives me the file name and not the path.

Please help

Qwerty
007

Controling Dialog Boxes With VB
Hi all
I have a program that calls another program. One of the properties of this other program is a Save as dialog box that opens before the program runs. I figured out (with some help from this fourm) how to get the name into the Save As Box, But I want to be able to run the program. Heres what I have so far

VB Code:
With Dialogs(wdDialogFileSaveAs).Name = WritePathPDF                      'puts the name in there.Execute                                             'I thought this would work but NopeEnd With

Any Ideas??


Thanks in advance

Common Dialog Boxes
I am using VB 6 service pack 5 and am using a dao datasource to connent to an access database.

At the moment the dao database name is c:databases
dbs.mdb

Say for some reason the database is moved I don't want to keep changing the dao database name within the program.

I have added the common dialog box to select the database if the path cannot be found, when I select the database from the common dialog box and this works fine, but when I re-open the program it doesn't remember the new path of the database.

How can I get my program to store the new database path perminantley?

Regards

Matt

Tabbed Dialog Boxes
Can anyone tell me how to make one of a row of tabbed dialog panels always come up as the default when running the app?

Common Dialog Boxes
How do you detect whether the user pressed cancel when using common dialog boxes?

Alex

Printer Dialog Boxes
Hi,

I need some help hoping it wont be to dificult to do, basically from a printer dialog box I need to grab the name of the selected printer not the default, so Im using the cdlPDSelection Flag and am getting the dialogs hDC property back but I have no idea what this is or how to use it please help.

Malal

Export Dialog Boxes
how do you bring up the default windows import/export dialog boxes?

the VB help files draw a total blank here

thanks in advance.

Tabbed Dialog Boxes
How do I add controls to tabbed dialog boxes? I understand that you can't double click the control to add it, but it still doesn't work when I draw it. Please Help...

Thx

Problem With Common Dialog Boxes
Hi All new member here so bare with me.


I have a in house Program to look up simple searches in flat text files (addresses , phone numbers, etc, etc,)

I have a problem/Bug with one part.


I have a menu option to have the user point to where are all files are located and stores these values in the registry. That all work just fine and dandy.

Here's the problem.


If I have already set the values for all the files, and I got to change it but deside not to, VIA Cancel button it puts in the value for the last item I set.

So

Addresses "c:addresses"
Fax "c:fax"

And I select Addreses again and hit the canel button it changes it to this

Addresses "c:fax"
Fax "c:fax"

Here is a snippet of the code I'm using..
--------------------------------

Code:
Private Sub mnuFile_charges_Click()
CommonDialog1.DialogTitle = "Choose Charges file..." 'set dialog box title
CommonDialog1.ShowOpen 'open dialog box
strcharges = CommonDialog1.FileName 'store the name of the file
If strcharges = "" Then 'checks to see if the dialog is empty if so nothing changes.
On Error GoTo ErrHandler
Else
SaveSetting "Lstar", "Files", "charges", strcharges 'save to registry

Exit Sub
ErrHandler:
Exit Sub
End If
End Sub


--------------------

Thanks for the help..

Stop Dialog Boxes On Web Browser
how do i stop message boxes from popping up from sites? the silent webbrowser property doesn't work.

or, if thats not possible

how do i get the value of a javascript variable??

Displaying Common Dialog Boxes
Hi all,

Is there a way to show common dialog boxes using VBA in Excel? Or maybe there's another way around this... This is what I need to do: I have an image control on a spreadsheet and I want to have it so that when the user double-clicks the control, it will present them with an "Open" dialog box for them to browse for their image and then assign that image to the image control. In VB, it's a simple matter of adding the Windows common dialog control to your project and calling its open method. Is there a way to accomplish this using VBA in Excel? Or is there a workaround for it?

Thanks for any help,

Tom

Answering Dialog Boxes Automatically
When running macros that cause dialog boxes to come that require you to answer yes or no to move on, is there a way to get a piece of code in there that will automatically answer yes?

In my case, I'm running an openquery macro on a "make table" query. It will (1) tell me that I will be modifying data and if would like to continue. (2)It will then tell me that the current table will be deleted. (3)It then tells that it will paste "x" number of rows to the new table. I would like, if possible, to answer "yes" to all of these questions.

Home Made Dialog Boxes
ok... I know you can use the common dialog control to get a file name, color, ect... I was wondering if there's a way to make your own dialog box. I guess the easiest way to do this would be to "pause" the program and have another form that would pop up with what you want to prompt the user for. The only problem with this is I don't know how (or if it's possible) to have a form (or something similar to a form?) return a value, or how to "pause" the rest of the program while the user enters data. Ideas anyone?

Thanks
~VBDude

P.S. I'm not sure if I explained everything correctly. Ask me if you need clarification.

MS Sapi With Modal Dialog Boxes?
Hello all,
I wrote a small app to voice-automate my desktop using Speech api 5.1 - very simple - brings up Open dialog initially and user navigates to exes and enters in - then a shared speech recognition context object with a limited command and control grammar with phrases such as "Start <appname>" and "Quit <appname>" - starts an .exe with Shell(), then on "Quit..." uses EnumWindows, GetThreadID, etc. and closes app and all children windows by sending WM_CLOSE messages to each.

However, I noticed that when a modal dialog box such as "Save Changes?.." pops up in a word processor or something on closing, if I attempt to process a "Yes" or "No" command, the reco object enqueues the events, and doesn't process until user manually clicks on button.

Of course, alternatively I can send WM_DESTROY to suppress dialogs, but this seems to cause Access violations in Apps such as MSAccess when several Access windows are open at the same time. Any suggestions? Thanks much.

Kent-Eric

MS Sapi With Modal Dialog Boxes?
Hello all,
I wrote a small app to voice-automate my desktop using Speech api 5.1 - very simple - brings up Open dialog initially and user navigates to exes and enters in - then a shared speech recognition context object with a limited command and control grammar with phrases such as "Start <appname>" and "Quit <appname>" - starts an .exe with Shell(), then on "Quit..." uses EnumWindows, GetThreadID, etc. and closes app and all children windows by sending WM_CLOSE messages to each.

However, I noticed that when a modal dialog box such as "Save Changes?.." pops up in a word processor or something on closing, if I attempt to process a "Yes" or "No" command, the reco object enqueues the events, and doesn't process until user manually clicks on button.

Of course, alternatively I can send WM_DESTROY to suppress dialogs, but this seems to cause Access violations in Apps such as MSAccess when several Access windows are open at the same time. Any suggestions? Thanks much.

Kent-Eric

Need Help With Dialog/Msg Boxes And SHDocVw (Explorer)
I'm developing an automation application with VB6, using SHDocVw to control Internet Explorer.

The sole thing I'm having an issue with is a message box on one of the pages, that pops up and has Ok and Cancel buttons.

I've searched high and low and have not found any leads on controlling this issue.

If anyone could assist in grabbing that message box and clicking the Ok button, I'd greatly appreciate it.

Handling Excel Dialog Boxes
I have written an enterprise level utility whose sole purpose in life is to seek out Excel and Visio documents and alter their paper sizes based on criteria specified in a configuration file (per my customers request).

The utility performs surprisingly well on Office XP and Office 2003. In Office XP and above, there is a method called EnableEvents (True / False) that determines whether or not macros fire. For obvious reasons, when the program is going through 10,000+ files, you do not want the macros executing.

However, on Office 2000, this method does not exist. As a result, you cannot prevent the macros from executing. Furthermore, if you try and trick the system by raising the security level of Excel to high for macros temporarily, the macros still execute as the documents are opened programmatically and as such inherit the trust given to the application that called it. This is a bad design and I have already submitted a request to change this behavior in future versions of Office as the behavior exists to this day.

I have been working an SRX with MS Dev's for a few weeks now on a solution to this problem and every solution we have come up with has hit one wall or another.

So I had a new thought that I want to test, but I have never done anything like it so I need some help getting started. The one document in particular that is causing problems is a time card that has several dialog box prompts. Now, regardless of what you answer (Y, N, Cancel, etc...), as long as you navigate through them, my program continues to execute.

What I would like to do is handle the dialog boxes and pass values to them. I have done some reading up on SendKeys, but I am unsure on how to implement them in my code.

Keep in mind that this one particular document has 3 "y/n" / OK dialog boxes in it so I need to be able to handle multiples.

Thank you for any assistance you can provide.

Jim

Modal Windows Dialog Boxes?
i displayed the windows Internet Settings dialog box, but i want it to be modal so that the user can not switch to any of my other forms/windows until the dialog box is dismissed. any way please
thanx
dayo

Dialog Boxes - Hiding Setup
I have created a dialog frame(box) and made a command button on another sheet to bring up the dialog frame/box, BUT when it comes up the formating (setup) sheet is behind it.

Is there a way to make it not do that?? I tried just hiding that worksheet (dialog sheet) but that didnt work??

Thanks
Kim

Closing Modal Dialog Boxes
How do i close all the modal dialog boxes before i close the parent form, that causes my application to terminate...

Using Filters In Common Dialog Boxes
I want the user only see the files with .edl extension only when browsing.

I have set the properties for defaultext and filter to *.edl but it still shows everything. (*.edl shows up in the CommonDialog box in the Files of Type window.... but that's it)

Can someone help?

Thanks,
Eric

Common Dialog Boxes (Big Question)
I want to add a preview window and a command button to the common dialog box OPEN... How do I do that...

Dialog Boxes - Open File
Does anyone know where I can get the dialog box that matches the Windows 98 format, as opposed to the old and simple default dialog box shipped with VB6.0 so that I can use it in my applications.

Cheers!

Error Handling - Dialog Boxes
i wanted to make sure my program didn't crash after the dialog box would return the results ... so added these things as precautions but now i can't even open up a file

my filter is set to *.txt|*.txt
my defaultext is set to .txt - (i've tried *.txt and *.txt|*.txt and *.txt|.txt)


Code:
On Error Resume Next

dlgfiles.Flags = cdlOFNFileMustExist
dlgfiles.flags = cdlOFNExtensionDifferent
'i've tried combining them too with AND & OR

dlgfiles.ShowOpen
thedir = dlgfiles.FileName

If thedir = "" Then
display = MsgBox("There was no file to open because cancel was pressed", vbCritical, "Reason for message box")
GoTo anerror
End If

If (dlgfiles.Flags And cdlOFNFileMustExist) = cdlOFNFileMustExist Then
display = MsgBox("The file you are trying to open does not exist", vbCritical, "Reason for message box")
GoTo anerror
End If

If (dlgfiles.Flags And cdlOFNExtensionDifferent) = cdlOFNExtensionDifferent Then
display = MsgBox("You are trying to open an invalid file type" & vbCrLf & "Only files that end in *.txt can be opened", vbCritical, "Reason for message box")
GoTo anerror
End If

'code for inputing stuff

anerror:
'right before end sub



does anyone know why i'm getting this error

Passing Variables To Dialog Boxes
Hi,
What is the best way to transfer variables to and from a dialog box? My
project consists of a form with a number of controls, lets say three Labels,
when a label is clicked it opens a dialog box with a text box in it and the
text box data will be returned to the label that was clicked. Don't laugh
but this is the code I use, it's OK for three controls but gets complicated
when using alot of controls and although it works I think its not the best
way. Any advice greatly appreciated.

Many thanks
Richard.



General Declarations:
---------------------------------------------------------------------
Public myLabel1 As String
Public myLabel2 As String
Public myLabel3 As String
Public myLabelNumber As Integer
---------------------------------------------------------------------



Form1 Events:
---------------------------------------------------------------------
Private Sub Label1_Click()
myLabelNumber = 1
Dialog.Show
End Sub
---------------------------------------------------------------------
Private Sub Label2_Click()
myLabelNumber = 2
Dialog.Show
End Sub
---------------------------------------------------------------------
Private Sub Label3_Click()
myLabelNumber = 3
Dialog.Show
End Sub
---------------------------------------------------------------------



Dialog Events:
---------------------------------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

Select Case myLabelNumber

Case 1
Form1.Label1.Caption = Text1
Case 2
Form1.Label2.Caption = Text1
Case 3
Form1.Label3.Caption = Text1
End Select

End Sub
---------------------------------------------------------------------
Private Sub OKButton_Click()

Unload Dialog

End Sub
---------------------------------------------------------------------

New Here; How Can I Tell When Excel Has Dialog Boxes Open?
When I use my vb6 app to export to Excel, I look for an existing instance and if there is one I use it instead of creating a new one.

The problem with this is that if the user has a dialog box open in the existing instance, the whole thing falls over. So far I've been unable to find a way to determine if the user has any dialog box open. I can tell if they have specific named ones open by using FindWindow but otherwise, no. I can't test for every single dialog box in Excel (there are hundreds) so I'm looking for a simple way to get around this problem.

Thanks in advance.

How To Create Dialog Boxes Dynamically
Hi,

Is there a way in VB to create dialog boxes dynamically depending on the values and controls(like textbox, button etc) submitted in the code?

thanks in advance

Open/Save Dialog Boxes
Hello,

I seem to be having problems getting this straight. If I open a file to be converted to another format, say .ico to .bmp I just click on the file and the name shows up in the text box without the extention which is what I want. But when it's suppose to be saved I can't get the filename (without extention) to showup in the save dialog box like it should. I'm trying to add some polish to a Icon2Bmp converter I found on the net. Nothing I've tried has worked, anyone have any ideas?

Jerome W. Norgren

Using VB6, SP3, Pro

Handling Excel Dialog Boxes In VB
I've set up an Excel database linked to a form, using the template wizard. When a form/record is saved, a dialog box appears with three choices (update existing record, create new record, continue without updating). I want to handle all this in a macro/VB, so a user can just press a button and not have to deal with the dialog box. I know how to disable the dialog box (DisplayAlerts = False) and save the form, but then the dialog box step is just skipped and the record's not saved to the database. Any ideas?

Thanks,

Will

Open/Save Dialog Boxes
What is the code to have open or save dialog boxes when you click on a command button (like the open/save buttons on the MS Word toolbar)?

Browser Control And Dialog Boxes
Using the Browser Control it is possible to capture new browser windows in a MDI application using the NewWindow2 event on the browser to create a new Child window.

However, I can not seem to find a way to do this for windows created via the jscript window.showModalDialog method. It seems to just pop up a modal browser window and does not seem to fire any events I can trap to place it into a browser window.

The 2 different methods to create a window are as follows
&lt;input type="button" onClick="window.open()" value = "Window.open()"&gt;

&lt;input type="button" onClick="window.showModalDialog()" value = "Window.showModalDialog()"&gt;

No events are fired to the Browser Control when the dialog box is created

Does anyone have an idea how I can catch this dialog window so I can host it in a browser control?

Thank you

David Stephen

Common Dialog Save Text Boxes
I know this must be asked and answered before but my search for this paticular scenario didn't get me anywhere. Here is what I'm aiming to accomplish.

Use common dialog to do a ShowOpen and ShowSave

Loop through my controls for TypeOf textbox and write to a text file using open for random


Not sure how to piece all of that together.

I want to allow the user to save what is visible on the screen (textboxes) to an ordinary text file using the common dialog.


Thanks in advance for any help on this


Max

Copyright © 2005-08 www.BigResource.com, All rights reserved