5 Replies - 562 Views - Last Post: 12 October 2012 - 10:25 AM Rate Topic: -----

#1 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Checkbox and moving the check

Posted 12 October 2012 - 08:49 AM

Hi,

I have a general question about the checkbox item in Visual Studio. Is it possible to have the check next to the label be dynamic and move depending on if the text is long? I would like to have this option if it's possible because on my app, if the price is longer than the text I set for it, the checkbox and the label will overlap(text right aligned, check center aligned)

Is this possible?
Is This A Good Question/Topic? 0
  • +

Replies To: Checkbox and moving the check

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9197
  • View blog
  • Posts: 34,551
  • Joined: 12-June 08

Re: Checkbox and moving the check

Posted 12 October 2012 - 08:52 AM

Certainly.. make a user control or a panel.. drop a label in said control.. dock the label to the left. Now drop a checkbox into the control. Set to fill. Now set your user control (or panel)'s height to about what.. 23? Just so it looks like one line. There you go.
Was This Post Helpful? 0
  • +
  • -

#3 Criel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 128
  • Joined: 11-March 11

Re: Checkbox and moving the check

Posted 12 October 2012 - 09:14 AM

I'm not seeing a fill property, what component would it be with? I can't see it on either the panel,label, or checkbox control
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9197
  • View blog
  • Posts: 34,551
  • Joined: 12-June 08

Re: Checkbox and moving the check

Posted 12 October 2012 - 09:23 AM

Look under Dock.
Was This Post Helpful? 0
  • +
  • -

#5 lar3ry  Icon User is offline

  • Coding Geezer
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,290
  • Joined: 12-September 12

Re: Checkbox and moving the check

Posted 12 October 2012 - 10:22 AM

Using a checkbox to hold a price is interesting, to say the least.

However, have you checked out the AutoSize property?
I think it would be preferable, from a friendly user interface point of view, to allow enough room for the longest label it's likely to have, rather than moving the checkbox button itself.
Was This Post Helpful? 0
  • +
  • -

#6 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Checkbox and moving the check

Posted 12 October 2012 - 10:25 AM

You might also look at putting the checkboxes into a FlowLayoutPanel so that they shift if the text in the previous control takes more room.

Attached Image
When the text of the checkbox changes the control beside it moves
Attached Image

This was done just putting the controls in a formlayoutpanel and changing the text property in code.

This post has been edited by CharlieMay: 12 October 2012 - 10:32 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1