From: johnb on
Hi Guys
I'm trying to get started on allowing the user move a button control around
a Form. For example I have say 30 jobs to do. Each button is a job and
clicking on it will reveal that job's details. The user wants not started
jobs on the left of a Form, those in progress in the middle and completed on
the right.

I don't think it's not a drag and drop job. It's more "Move a control at
runtime" by dragging it

TIA
johnb
From: Onur Güzel on
On May 7, 6:32 pm, johnb <jo...(a)discussions.microsoft.com> wrote:
> Hi Guys
> I'm trying to get started on allowing the user move a button control around
> a Form. For example I have say 30 jobs to do. Each button is a job and
> clicking on it will reveal that job's details. The user wants not started
> jobs on the left of a Form, those in progress in the middle and completed on
> the right.
>
> I don't think it's not a drag and drop job. It's more "Move a control at
> runtime" by dragging it
>
> TIA
> johnb

Hi,

Refer to my old post that contains code how to move control at
runtime:

http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/9752f427a4ca5061/f2f7c1e2456c8230?hl=en&q=dragging#f2f7c1e2456c8230

HTH,

Onur Güzel
From: johnb on
Hi Onur

Thanks for the info, I'll try it out today.

regards
johnb

"Onur Güzel" wrote:

> On May 7, 6:32 pm, johnb <jo...(a)discussions.microsoft.com> wrote:
> > Hi Guys
> > I'm trying to get started on allowing the user move a button control around
> > a Form. For example I have say 30 jobs to do. Each button is a job and
> > clicking on it will reveal that job's details. The user wants not started
> > jobs on the left of a Form, those in progress in the middle and completed on
> > the right.
> >
> > I don't think it's not a drag and drop job. It's more "Move a control at
> > runtime" by dragging it
> >
> > TIA
> > johnb
>
> Hi,
>
> Refer to my old post that contains code how to move control at
> runtime:
>
> http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_thread/thread/9752f427a4ca5061/f2f7c1e2456c8230?hl=en&q=dragging#f2f7c1e2456c8230
>
> HTH,
>
> Onur Güzel
> .
>
From: johnb on
Onur,
That works a treat! But how do I persist(save) those new control postions,
so that when the app is closed and opened the last positions are maintained.

regards
johnb

"johnb" wrote:

> Hi Guys
> I'm trying to get started on allowing the user move a button control around
> a Form. For example I have say 30 jobs to do. Each button is a job and
> clicking on it will reveal that job's details. The user wants not started
> jobs on the left of a Form, those in progress in the middle and completed on
> the right.
>
> I don't think it's not a drag and drop job. It's more "Move a control at
> runtime" by dragging it
>
> TIA
> johnb
From: Onur Güzel on
On May 8, 1:09 pm, johnb <jo...(a)discussions.microsoft.com> wrote:
> Onur,
> That works a treat! But how do I persist(save) those new control postions,
> so that when the app is closed and opened the last positions are maintained.
>
> regards
> johnb
>
> "johnb" wrote:
> > Hi Guys
> > I'm trying to get started on allowing the user move a button control around
> > a Form. For example I have say 30 jobs to do. Each button is a job and
> > clicking on it will reveal that job's details. The user wants not started
> > jobs on the left of a Form, those in progress in the middle and completed on
> > the right.
>
> > I don't think it's not a drag and drop job. It's more "Move a control at
> > runtime" by dragging it
>
> > TIA
> > johnb

Hi John,

You have a couple of choices. You can try to use My.Settings by
defining control's Location property's X and Y coordinates.

http://msdn.microsoft.com/en-us/library/saa62613(VS.80).aspx

Plus, just save location's X and Y coordinates in a text-based file
using File.WriteAllText:

http://msdn.microsoft.com/en-us/library/system.io.file.writealltext.aspx

Also, you can find an INI library to group each control's location in
the same way you're storing locations in human-readable format:

http://www.google.com/search?hl=en&client=firefox-a&hs=w9l&rls=org.mozilla%3Atr%3Aofficial&q=vb.net+ini+library&aq=f&aqi=&aql=&oq=&gs_rfai=

You need to apply the settings in Form_Load and save anytime you want,
preferably in Form_Close events.

HTH,

Onur Güzel