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




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




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving Picture Boxes
I am making a soccer shoot-out game and i want to move the soccerball (the Picture Box) to where the player selects eg. top right, top left, top centre, bottom right, bottom left, bottom centre. If someone could please help me with this code it would be much appreciated

Moving Text Boxes
Hiii,
I need to move a text box to the mouse point. How can I move. How can I get the mouse location.

Thanks
Sam

Moving Boxes With Loops
Private Sub cmdleft_Click()
Loop
frmloop.Left = frmloop - 1
Do Until frmloop.Left = 2
End Sub

Private Sub cmdright_Click()
frmloop.Left = frmloop + 1
End Sub

Private Sub cmdup_Click()
frmloop.Top = frmloop - 1
End Sub

Private Sub Cmddown_Click()
frmloop.Top = frmloop - 1
End Sub

Private Sub Command6_Click()
Unload Me
End Sub

It keeps saying I have a loop without a do in the first cmd. THE DO is there. Why doesn't it like me.

Moving Picture Boxes
Does anybody know how to move a picture boxe across the screen within a visual basic form.

Moving Multiple Picture Boxes - Lag?
On my form I have a control array of 239 picture boxes NOT being moved. Then I create 5 picture boxes of a new control array and move them with a timer with the interval set to 10. It moves fine, but when I load another 5 picture boxes totaling 10 the game starts to lag by the images starting to move slower then set to. The more I load and more the slower it keeps getting.

I am increasing the .top of all of the picture boxes by 25 every time the timer ticks with a 10 interval.

How can I prevent this 'lag'?

Problem Moving Between Text Boxes
Hi all,

I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..

Private Sub Text1_LostFocus()
If (Text1.Text = "") Then
MsgBox ("TextBox 1 is empty please reenter ")
End If
Text1.SetFocus
End Sub

Private Sub Text2_LostFocus()
If (Text2.Text = "") Then
MsgBox ("TextBox 2 is empty please reenter ")
End If
Text2.SetFocus
End Sub

The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?

Thank You

Senthil

Moving Item Between List Boxes
I have a command button with the Caption ">". When clicked I want the selection the user has made in ListBox1 to be moved to ListBox2.

Anyone ever do something like this before?

thx..

Problem Moving Between Text Boxes
Hi all,

I have a Form with two text boxes. All the controls have the VB assigned default names. Basically I want the user to enter the data before he leaves the text box to the next one, by pressing tab or using the mouse. So I tried using the following code ..
Code:
Private Sub Text1_LostFocus()
    If (Text1.Text = "") Then
        MsgBox ("TextBox 1 is empty please reenter ")
    End If
    Text1.SetFocus
End Sub

Private Sub Text2_LostFocus()
    If (Text2.Text = "") Then
        MsgBox ("TextBox 2 is empty please reenter ")
    End If
    Text2.SetFocus
End Sub

The problem is that if I move from Textbox1 to Textbox2 by pressing Tab, I get the Msgbox saying "Text Box1 is Emtpy" , but when I click Ok, the control returns back to Text1, but in the process it triggers the lost focus event of Text2 so I get the message "Text box 2 empty" and this messages cycle on for ever, and I end up killing my application. Can anyone suggest a way to avoid this problem ?

Thank You

Senthil



Edited by - IDontKnow on 8/10/2004 9:31:36 PM

Moving Picture Boxes W/ Keyboard
is there a way to be able to move picture boxes using the keyboad? i.e picturebox1 moves up using the caps lock key, and down by using the shift key. picturbox2 moves up using the plus sign(the one all the way to the right of the keyboard no the one above the equal sign) and moves down by hitting the enter key(under the plus sign).thnx in advance for any help.

Moving Data Between List Boxes
Hi,
I need a little help if anyone has a moment. I have 2 list boxes one called lstSource and the other is lstDestination. I have it set up and working so that I can multi select rows in my source and move them into my value list in my destination list box. I call the function in the click even of a right arrow button. This works great.

Now I want the user to be able to remove fields from the lstDestination in case they make a mistake or change their mind. I want to do this using a left arrow button but I can't quite get the code working properly. I have gotten it to do everything butx but....however, I can't get it to just delete the selected row(s). Here is my code that is working to move my rows from my lstSource to my lstDestination. I assume it must be some variation of this....

<vb code>
Private Sub cmdCopyItem_Click()
CopySelected Me
End Sub

Function CopySelected(frm As Form) As Integer
Dim ctlSource As Control
Dim ctlDest As Control
Dim strItems As String
Dim intCurrentRow As Integer
Set ctlSource = frm!lstSource
Set ctlDest = frm!lstDestination
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
strItems = strItems & ctlSource.Column(0, _
intCurrentRow) & ";"
End If
Next intCurrentRow
' Reset destination control's RowSource property.
ctlDest.RowSource = ""
ctlDest.RowSource = strItems
End Function
</vb code>

Is The Copying Or Moving Dialog Box Opening?
can someone give me some code to catch the event when the copying or moving dialog box opening.

thanks.

Moving Arround A Control Array Of Txt Boxes
hi could any body tell me how i can use the arrow keys to move between txtboxes in a control array i have 41 txtboxes in the form of 7 columns by 6 rows.

the code i came up with as an idea was:

Code:
Dim iLoc As Integer
txtPuz(Index) = iLoc
If KeyCode = vbKeyUp Then
If iLoc > 6 Then
iLoc = iLoc - 7
txtPuz(iLoc).SetFocus
End If
End If

If KeyCode = vbKeyDown Then
If iLoc < 35 Then
iLoc = iLoc + 7
txtPuz(iLoc).SetFocus
End If
End If

It didnt work properly when set to the forms keydown event. so what code would be best and where would i put the code?

Thanks

Moving Already Created And Configured Controls Into Frames/picture Boxes
I'm sure there is a simple way of doing this or a quick fix, but I'm currently struggling. I've made and coded for some controls (pictureboxes that move accross the screen).

However, I now want them to only be visible inside a picture box I have just created. But when run the image just moves behind it. I'm using sprites and the BitBLT method to draw and move my object.

Any suggestions appreciated.
Thanks

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
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 =/

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

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

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