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. C#
  4. Form, Tabs and Controls --- Resizing Them

Form, Tabs and Controls --- Resizing Them

Scheduled Pinned Locked Moved C#
cssjsonhelptutorial
2 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.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hey all, I've been playing with this for two days now and I cannot get this to work. I have a form, two TabControls on the form. In one of the TabControls, I have a datagrid in there along with a textbox and a search button. I am trying to get the auto-resize anchor/dock functions working correctly, but nothing that I do seems to work. I've tried panels, splitters, using the Anchor/Dock methods every way I can think, but it never displays properly. Basically, it looks like this: [SEARCH TEXT BOX] [SEARCH BUTTON] * DATA GRID HERE TAKING UP REST OF THE SCREEN(TAB) * I want it so that when the user resizes the form, it leaves the search text box and the search button on the top (not resize them and make them huge), but only resizes the datagrid to take up the remaining space. When I play with all the different features, the datagrid usually ends up overtaking the space where the search bar/button is, and it overlaps. I'm clueless as to how to make this work properly. Any help would be appreciated.

    A 1 Reply Last reply
    0
    • S shultas

      Hey all, I've been playing with this for two days now and I cannot get this to work. I have a form, two TabControls on the form. In one of the TabControls, I have a datagrid in there along with a textbox and a search button. I am trying to get the auto-resize anchor/dock functions working correctly, but nothing that I do seems to work. I've tried panels, splitters, using the Anchor/Dock methods every way I can think, but it never displays properly. Basically, it looks like this: [SEARCH TEXT BOX] [SEARCH BUTTON] * DATA GRID HERE TAKING UP REST OF THE SCREEN(TAB) * I want it so that when the user resizes the form, it leaves the search text box and the search button on the top (not resize them and make them huge), but only resizes the datagrid to take up the remaining space. When I play with all the different features, the datagrid usually ends up overtaking the space where the search bar/button is, and it overlaps. I'm clueless as to how to make this work properly. Any help would be appreciated.

      A Offline
      A Offline
      Alexander Wiseman
      wrote on last edited by
      #2

      Hi shultas, Give the following a try: Search Text Box Settings First, make sure the Dock property is set to "None". Set the Anchor property to Left, Top, Right. This should make the text box expand its width, but not its height when the form is expanded. Search Button Settings Again, make sure Dock is set to "None". Set the Anchor property to Top, Right. This should make the search button attach itself to the right side of the form when the form is expanded, but keep its width the same. Data Grid Settings Make sure Dock is set to "None". Set the Anchor property to Left, Top, Right, Bottom. This should make the data grid expand its width and height with the form when it is resized. Tab Control Settings I'm not sure where your two tab controls are positioned relative to the form, but you'll need to adjust the Anchor property of the tab control which contains the data grid, search text box, and search button. I think you'd probably want to set the Anchor property to Left, Top, Right, Bottom, so that it gets its share of the extra horizontal and vertical space when the form is expanded. Give those settings a shot. If it doesn't work, please let me know and I'll try to help you as best I can. Sincerely, Alexander Wiseman

      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