Author Topic: Image placement  (Read 1688 times)

Rookie 2017

  • Newbie
  • *
  • Posts: 10
    • View Profile
Image placement
« on: May 03, 2017, 01:35:31 PM »
Hey all,

I want to have a second form that defaults to maximum (fill frame) - that's easy

Secondly, I want an image that defaults to the right top hand corner and fills roughly 3/4 of the screen so my buttons can be beside it - again easy

Lastly, I want 4 buttons in the corners of that image

it works great on the screen I'm working great on, how can I set this up so it will default to maximize and look good on any screen being used as it may be a larger or smaller screen

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Image placement
« Reply #1 on: May 03, 2017, 01:56:37 PM »
Winforms is not really ideal for running an application on different screen resolutions. The best tools you have to work with is the TableLayoutPanel and the FlowLayoutPanel. Using the TableLayout panel, you can add objects to the cells and set them to fill.

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: Image placement
« Reply #2 on: May 03, 2017, 02:20:22 PM »
if i may

am a noop
http://www.dreamincode.net/forums/topic/228259-adjust-controls-sizeposition-with-screen-resolution/


this post i found may be helpful for you

the only problem that u might face is that you need to change the font size

advice : build your project in the lowest form size you need it to work on

and this code will maximize it to any monitor  resolution

i hope  it works with u

Rookie 2017

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Image placement
« Reply #3 on: May 03, 2017, 03:30:13 PM »
The table layout works well except I cant place my buttons on top of my centre image,

Ill try option 2 tomorrow!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Image placement
« Reply #4 on: May 03, 2017, 03:57:57 PM »
The TableLayoutPanel only lets you place one component in a cell, but you can place a Panel in a cell, dock it to fill. Then make the background image of the panel your picture. You can now add multiple buttons in the cell with the panel. Then use anchors to tie them to the corners.

Rookie 2017

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Image placement
« Reply #5 on: May 04, 2017, 04:16:17 PM »
yes, had that in the works this morning and it worked great!

Thanks

joko markono

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Re: Image placement
« Reply #6 on: November 16, 2019, 09:16:03 PM »
I'm sorry, i add this link here because i think the tricks on the table layout panel are very useful
Insert table in table layout cell: [url]https://youtu.be/FWd6HF6vhcc[url]
Resize setting:[url]https://youtu.be/GbEtexBWdxg[url]
« Last Edit: November 16, 2019, 09:26:26 PM by joko markono »