10 Replies - 1575 Views - Last Post: 28 July 2012 - 12:32 AM Rate Topic: -----

#1 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

when form resize within form controls are also resized

Posted 25 July 2012 - 12:25 AM

Command1.Move 1725, 1200, Command1.Width, Command1.Height
Command1.Width = Command1.Width + (Me.Width - 4800)
Command1.Height = Command1.Height + (Me.Height - 3600)
Is This A Good Question/Topic? 0
  • +

Replies To: when form resize within form controls are also resized

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: when form resize within form controls are also resized

Posted 25 July 2012 - 02:59 AM

Please provide some more information...

is this a code sample or do you have a problem?
Was This Post Helpful? 0
  • +
  • -

#3 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

Re: when form resize within form controls are also resized

Posted 25 July 2012 - 04:09 AM

View Postmaj3091, on 25 July 2012 - 02:59 AM, said:

Please provide some more information...

is this a code sample or do you have a problem?


my requirement is when drag the form,
controls are automatically dragged. like command button,textbox,label and so on
Was This Post Helpful? 0
  • +
  • -

#4 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: when form resize within form controls are also resized

Posted 25 July 2012 - 08:31 AM

uumm.. when you drag a form on the screen all controls inside it are already dragged too.
it seems you try to change their size according to the form's size.. what is the problem then?
Was This Post Helpful? 0
  • +
  • -

#5 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

Re: when form resize within form controls are also resized

Posted 26 July 2012 - 03:39 AM

View PostNeku, on 25 July 2012 - 08:31 AM, said:

uumm.. when you drag a form on the screen all controls inside it are already dragged too.
it seems you try to change their size according to the form's size.. what is the problem then?



my problem is when drag the form command button width will be too long. this is my problem
Was This Post Helpful? 0
  • +
  • -

#6 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: when form resize within form controls are also resized

Posted 26 July 2012 - 07:04 AM

did you place the code you posted in the form's resize subrotin? because that dosent sound like a normal behavior for your program
Was This Post Helpful? 0
  • +
  • -

#7 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: when form resize within form controls are also resized

Posted 26 July 2012 - 08:14 AM

Oh, I think I see what you're trying to do. If you want to SIZE your controls, use Height and Width properties. If you want to POSITION your controls, use Top and Left properties. I think you're confusing the two.
Was This Post Helpful? 0
  • +
  • -

#8 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: when form resize within form controls are also resized

Posted 26 July 2012 - 12:23 PM

i think there is a solution already posted for this kind of problem, just search the snippet or tutorial section, i am not sure which one it contains but it is here just dig it out and get that treasure
Was This Post Helpful? 0
  • +
  • -

#9 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

Re: when form resize within form controls are also resized

Posted 27 July 2012 - 01:33 AM

if form width increase 1000 then control width will be 1000 increased?
Control size 1000 increased properly, but control goes to out of the form
i used command button
Was This Post Helpful? 0
  • +
  • -

#10 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: when form resize within form controls are also resized

Posted 27 July 2012 - 04:23 AM

If you want you're button to resize, try using a constant for it's width, instead of it's actual width, otherwise you're adding exponentially to it's size.

For example, when you start your program, your button is 200 * 100 twips.

So your resize code would be something like:

Command1.Width = 200 + (Me.Width - 4800)
Command1.Height = 100 + (Me.Height - 3600)


This way, the button resizes with the form. Just make sure to trap the condition of negative sizing!
Was This Post Helpful? 1
  • +
  • -

#11 mani9597  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 19-July 12

Re: when form resize within form controls are also resized

Posted 28 July 2012 - 12:32 AM

View Postmaj3091, on 27 July 2012 - 04:23 AM, said:

If you want you're button to resize, try using a constant for it's width, instead of it's actual width, otherwise you're adding exponentially to it's size.

For example, when you start your program, your button is 200 * 100 twips.

So your resize code would be something like:

Command1.Width = 200 + (Me.Width - 4800)
Command1.Height = 100 + (Me.Height - 3600)


This way, the button resizes with the form. Just make sure to trap the condition of negative sizing!


hi maj ur code was really helpful,when i was try that code i got an exiting result. really u done a great job



thanks
mani
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1