Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Edit A Subcontrol within a control

Edit A Subcontrol within a control

Scheduled Pinned Locked Moved Visual Basic
csshelpquestioncareer
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Polymorpher
    wrote on last edited by
    #1

    I am building a control, within this control is a data grid...The data grid needs to be changed depending on the form that it is on...but when you build a control and then drag it onto a form...you can no longer edit the controls that you placed on that control...any sugestions?

    -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

    D 1 Reply Last reply
    0
    • P Polymorpher

      I am building a control, within this control is a data grid...The data grid needs to be changed depending on the form that it is on...but when you build a control and then drag it onto a form...you can no longer edit the controls that you placed on that control...any sugestions?

      -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Polymorpher wrote:

      The data grid needs to be changed depending on the form that it is on

      The control shouldn't care about what form it's on. It should be modified by the form code only if necessary.

      Polymorpher wrote:

      you can no longer edit the controls that you placed on that control

      What does this mean? How do you want to "edit the controls"??

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      P 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Polymorpher wrote:

        The data grid needs to be changed depending on the form that it is on

        The control shouldn't care about what form it's on. It should be modified by the form code only if necessary.

        Polymorpher wrote:

        you can no longer edit the controls that you placed on that control

        What does this mean? How do you want to "edit the controls"??

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        P Offline
        P Offline
        Polymorpher
        wrote on last edited by
        #3

        My control contains a grid control as well as some other controls, when I drag my control onto a form from the toolbox, I want to be able to move the grid within my control and change some of the settings on the grid etc.

        -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

        D 1 Reply Last reply
        0
        • P Polymorpher

          My control contains a grid control as well as some other controls, when I drag my control onto a form from the toolbox, I want to be able to move the grid within my control and change some of the settings on the grid etc.

          -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          You're going to have to add code to your control to handle dragging the grid around at design time. The designer won't do it for you because it doesn't support designing constituent controls seperate from the user control that contains them, at the controls runtime. The properties will all have to be re-exposed as public properties of the user control. A user control's runtime doesn't begin when the forms project the control is used in is finally run. A User Control's runtime begins when an instance of the control is created on the host form. From your description, it sounds like it would be better to just break the datagridview out on its own and not have it as a constituent of a user control.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups