Results 1 to 6 of 6

Thread: [RESOLVED] MDI forms and textboxes on child forms not editable

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Resolved [RESOLVED] MDI forms and textboxes on child forms not editable

    I'm very much a newcomer to MDI forms, and I found a method posted here which worked fine. In every form in my program I added the setparent part of the code and all forms load into it fine, but that's where the weirdness begins.

    Firstly, if I set a form as an MDI child (as I assume I need to) the form's width/height is set weirdly...but I would assume I could fix that on form_load so haven't worried too much about it for now (plus I don't think I really need to set it as a child as it's an internal form and seems to work fine without being set)

    Secondly, textboxes which have worked fine in the past as single non-MDI forms (with the forms not set as child) but once they're added into the MDI form (or any form, MDI or otherwise) they're not editable...I can click but it doesn't highlight the text within, and I can't type anything into them. MOST of what the program does actually doesn't require any typing, but I would nevertheless like to know how to fix it as some parts do need to be typed into

    Has anyone any suggestions about either of these issues?
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MDI forms and textboxes on child forms not editable

    In the vast majority of cases you shouldn't be using SetParent for your own forms, you should simply set the MDIChild property - they will then load into the MDI parent, and should behave normally.

    You should never use both methods together, as they will conflict badly.

    Is there a reason you aren't just setting the MDIChild property?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: MDI forms and textboxes on child forms not editable

    No reason really, I'm fairly new to MDI (as I said above) and you know what an amateur programmer I am from experience :-)

    However, I'm now not using the MDIchild, and I will try as you said above (doing the opposite to what I have done) and see how it goes...and will reply to this when I've tested it
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: MDI forms and textboxes on child forms not editable

    Update: It seems to work fine and you've sorted the most important problem for me (and gained the reputation for it, of course...or would have if VBF would let me give you more :-))...but any idea about the child form resizing itself? In design time it's correctly laid out but it jumps in size

    In design
    w4695 h1830

    When running on MDI form
    w15690 h6990

    The settings have also changed from width/height to scalewidth/scaleheight...might have something to do with it, they were just width/height when they were normal forms (although other forms which used the setparent but not mdichild are all fine size-wise)
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MDI forms and textboxes on child forms not editable

    The size shouldn't change unless you have code to do that.

    The only thing that springs to mind is the BorderStyle property - try a different value, particularly if you are currently using 'None'.
    The settings have also changed from width/height to scalewidth/scaleheight...might have something to do with it, they were just width/height when they were normal forms (although other forms which used the setparent but not mdichild are all fine size-wise)
    I'm afraid I have no idea what you mean... forms have all 4 of those properties whether they are Child or not.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: MDI forms and textboxes on child forms not editable

    If the form is sizeable it jumps in size, if it's fixed it doesn't...and if it is sizeable I have to set it to size on load (and none are marked as "none")...but all is fixed now so I'll mark this resolved, thanks!
    Well, everyone else has been doing it :-)
    Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
    Expect more to come in future
    If I have helped you, RATE ME! :-)

    I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!

    And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.

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