473,395 Members | 2,783 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,395 software developers and data experts.

Problems w/ Forms

Skill level: advanced newbie

I'm having trouble understanding how to show/hide/dispose/bringtofront forms. Here's what I'm trying to do-
FrmMain_Load
User is looking at frmMain
User makes a selection from comboBox1
comboBox1_SelectedIndexChanged calls sub New() in Module1
(*1) sub New puts frmDialog on top of frmMain
frmDialog has 3 btns (btnNew, btnCopy btnCancel)
User clicks btnNew
frmDialog/btnNew_SelectedIndexChanged code sets strResponse to "New"
(*2) frmDialog disappears
Back to sub New()
[code]
(*3) sub New/ Case(strResponse), Case "New" puts frmDialog on top of frmMain AGAIN
[strResponse not needed after this]
User clicks btnCopy this time
frmDialog/btnCopy_SelectedIndexChanged code sets strResponse to "Copy"
(*4) frmDialog disappears, frmMain is there
Back to sub New/ Case(strResponse), Case "Copy"
[strResponse not needed after this]
[code copies a file]
(*5) end sub New (Exit??)
(*6) Return to frmMain to make another selection using comboBox1

Can you tell me what commands to use for *1 - *6? to do what I want to do?
I've tried many combinations.
so far...
frmDialog.ShowDialog() seems to work at *1
Me.Close at *2
frmDialog.ShowDialog() at *3
Me.Close at *4
If I do this at *5, *6
frmMain.Visible = false
frmMain.ShowDialog()
it looks like it works but it runs frmMain_Load again which does a bunch of stuff I don't want to do.
So *5 and *6 are the problem (I think)

Can you help??
Thanx Paul.James@snet.net
Jul 10 '08 #1
1 808
Plater
7,872 Expert 4TB
For *1, you want want to use .ShowDialog() on your dialog form. That forces the user to deal with that particular form before doing anything else. It will also block code, so your new sub won't continue until the form is dealt with.
That should actually handle *1 and *2, start with that?
Actually it looks like that is good for all of them, and you have that part.
Why are you calling Me.Close? That will close the window that that code is executed on?
Jul 10 '08 #2

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

Similar topics

9
by: Eva | last post by:
Hi, I wanted to know how i can enter values into a specific column of a listview. I have tried the following code but this seems to enter all my values into the first column!!! Can anyone...
2
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you...
9
by: please-answer-here | last post by:
What is wrong with this code? when i place "return false" before the xfab assignment the form as intended doesn't submit. But when placed as here or in the last if/else construct the page gets...
0
by: JMCN | last post by:
i have been running into some ftp problems. when i run the ftp, the log indicates that it has been ftp'd. here is my ftp log: USER XX PASS XXX CONNECT XXX.dns.com CD $1$DKB101: GET...
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
3
by: Scott | last post by:
Hello, we are having problems displaying non-aspx files (images, style sheets) since we have upgraded to the 1.1 framework when using a cookieless session (sessionID in the url). Check out...
4
by: john | last post by:
I'm having some Interop problems. I really need someone's help on this, i'm running out of ideas. I have upgraded my Data access controls to the latest ver. Now then i have a form with these...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
2
by: Magnus Bergh | last post by:
I got a weird problem with designer. I have created a spearate assembly (DLL) containing my dataset classes and other classes which are shared bewteen the projects in the solution. When I try to...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.