Results 1 to 17 of 17

Thread: One Main Form

  1. #1

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91

    One Main Form

    I got more than 3 forms in my app.I want to make the main form disabled when form2loads and keep it like that untill the the form2 unloads what i am trying to say is how can you make a form a sub form
    Here is the problem
    when I load form1 from the main form I see two forms in taskbar Main and form1. I wand form1 in Main Form Like a Sub Form

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Then use an MDI form instead.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    ... because you can have several sub forms within the MDI form, and the taskbar only shows one window.

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Just set the ShowInTaskBar property of the 2nd and 3rd for to false, then when you show the form, do something like this:

    Form2.Show vbModal, Form1

    That will make the main form disabled until you close the Form2.
    <removed by admin>

  5. #5

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91

    Talking

    Form2.Show vbModal, Form1 <------ this is the thing I was looking

  6. #6

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91
    you can open a text file in Notepad by using this command in RUN
    notepad "c:\vb.txt"
    can I make my app to open a file by useing this

  7. #7
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You want to open the file in notepad? Just use the shell command:

    VB Code:
    1. Shell "C:\Windows\Notepad.exe C:\vb.txt"
    <removed by admin>

  8. #8

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91
    Originally posted by MidgetsBro
    You want to open the file in notepad? Just use the shell command:

    VB Code:
    1. Shell "C:\Windows\Notepad.exe C:\vb.txt"
    No I want to open a text file in my app
    something Like this
    Shell "C:\myapp.exe c:\vb.dat

  9. #9
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217

    Well...

    assuming you want to open it in a textbox called text1:

    VB Code:
    1. Private Sub Form_Load()
    2. Open Command for Input As #1
    3. Text1.Text = Input$(LOF(1), 1)
    4. Close #1
    5. End sub
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  10. #10

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91

    Talking

    Can I share variables in Different "compiled" projects .One more thing is it possible to open a form more than 2 times in a project

  11. #11

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91
    ANY ONE

  12. #12
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by internet_wiz
    Can I share variables in Different "compiled" projects .One more thing is it possible to open a form more than 2 times in a project
    Not unless you create an activex exe that both programs can access, or if you save the variable data to a registry key, then have the other program read it, then delete it. Or you could do the same thing with a text file or ini or anything.

    VB Code:
    1. Private Sub Command1_Click()
    2. Dim blah As New Form1
    3. Load blah
    4. blah.Visible = True
    5. End Sub
    That will load as many form1s as you can fit in memory.
    <removed by admin>

  13. #13

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91

    uhh...

    Originally posted by MidgetsBro


    Not unless you create an activex exe that both programs can access, or if you save the variable data to a registry key, then have the other program read it, then delete it. Or you could do the same thing with a text file or ini or anything.

    VB Code:
    1. Private Sub Command1_Click()
    2. Dim blah As New Form1
    3. Load blah
    4. blah.Visible = True
    5. End Sub
    That will load as many form1s as you can fit in memory.
    that worked but I still have tiny problem.I have three forms
    Main
    Receiver
    Reader

    this is my code
    In Main
    Receive.show vbmodal , Main

    in Receive
    dim nReader As New Reader
    Load nReder
    nreader.Visible = True
    when I do this I get an error "Cant show non modal form when a modal form is displayed

  14. #14
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    So you will have to open the Receiver window as non modal, or open the reader window as modal to the receiver window.
    <removed by admin>

  15. #15

    Thread Starter
    Lively Member internet_wiz's Avatar
    Join Date
    Nov 2001
    Location
    Gonagbango
    Posts
    91

    Did you read my other post??

    Originally posted by MidgetsBro
    So you will have to open the Receiver window as non modal, or open the reader window as modal to the receiver window.
    The thing is I want to open receiver window as a modal and reader window as non modal I tried diffirent ways but no success
    Can i DO THAT

  16. #16
    Hyperactive Member
    Join Date
    Dec 1999
    Posts
    321
    Again, the use MDI-forms would help in this case.

    When you have a modal form open, all other forms in the project are non-interactive to the user until that form is closed, so there is really no need to open a non-modal form from a modal form since the user cant interact with it anyway. Try disabling main instead and opening both Reader and Receiver as non-modal.

    Main.Enabled = False
    This efficiently disables the user from interacting with Main until you chose so (Main.Enabled = True) without making it modal.
    Last edited by Rodik; Jul 7th, 2002 at 04:17 AM.
    Signed, Rodik ([email protected])
    Programmer,usesVB6ED
    ===========================
    Copyright©RodikCo,2002.

    Dont mind this signature ;] Its old

  17. #17
    Hyperactive Member
    Join Date
    Dec 1999
    Posts
    321
    You could the same way make Reader(x).Enabled = False to disabled the user from messing with it...
    Signed, Rodik ([email protected])
    Programmer,usesVB6ED
    ===========================
    Copyright©RodikCo,2002.

    Dont mind this signature ;] Its old

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width