-
January 18th, 2014, 10:02 AM
#1
How to prevent WinForm location from changing
Hi all,
I am having a winform where in I am using some panels and other controls that are outside as well as inside of the panels. In the Form class, I have created certain visibility change events and added event handlers to these events. I also change the location of a few controls in the Form on selection of radio buttons to change the controls checked/visible/populated and so on. However, while I fire a selection change event for the radio button, the location of form changes as well and in some cases, it changes to the location of the control that was clicked or the point of mouse click or some times the form even goes out of bounds of screen partially. Can anyone know the reason for this? Any suggestions are much appreciated.
Thanks,
Bhushan
-
January 18th, 2014, 01:42 PM
#2
Re: How to prevent WinForm location from changing
Probably a mistake in the code. If you want to help, you'll have to provide some of the code in question. Use CODE TAGS
-
January 19th, 2014, 07:38 AM
#3
Re: How to prevent WinForm location from changing
Hi,
There are certain radio buttons and panels whose location is being changed on selection of radio buttons. I have looked into the code and that is all there is to it. Now, does this cause an invalidate for the control and is followed by Form.Invalidate()? And even if it is so, then why should the location of the main form change? Could it be that the controls were going out of bounds and hence the form's default location was changed. I am sorry that I cannot post the code as it is huge, but try to resolve this and then post the specific portion of the code.
Thanks,
Bhushan.
-
January 19th, 2014, 01:46 PM
#4
Re: How to prevent WinForm location from changing
Then, I'd recreate a small sample, and attempt to reproduce your results. Add some controls to a form, and see what happens. If it happens then, you could post your small app's code for us to look at. Otherwise, we can't help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|