Can't place objects everywhere on the TabControl - c#

When I try to add something on my TabControl in certain places, it automatically moves it into another Tab.
For example I can add a `Label' here:
But not here:
It automatically moves to the other Tab when I add it in the middle.

Hah, thank you Hans Passant for the answere. I'll write it here as an answere if someone else get this "bug". How I fixed it:
Change the tabcontrol from alignemnt Left to Top and then back to Left again.
Idk why it works but it does (y) :D
EDIT: wait... now it dosn't work again?.. crap
NEW EDIT: OK. Now I figured out what was causing it. I was using VB power packs and when I removed that it now works (y)

Related

VS IDE setting, for more code real estate

So here's the issue, i've removed just about everything i've found in the program- but i can not figure out for the life of me how to remove the useless whitespace that was where the line numbers were, which is completely irrelevant to me, you are basically losing 1/8th of the entire screen to useless whitespace in this IDE, and i'd like to remove it, but i dont see a setting for it, does anyone know where it is ? - basically you can see on the red lines what i mean to remove, also does anybody know how to remove the blue little extra bar? Also useless to me. Thankyou to whoever can point me to a setting where i can switch off this and retrieve some of my lost screen real-estate.
That area is for the Intellisense "Hint" icon, the track changes, selection margin, and indicator margin. Those settings are found by opening Tools > Options > Text Editor > General:
Here is what my IDE looked like before deselecting them:
And then after:

is there a way to parent everything from another control BUT its location?

Nothing much to it, just a general question. I've searched for ages on the web but I can't find anything that answers my question.
is this possible? I want to parent one picturebox to another (which is below the one I want to parent) to allow the transparency to work properly for the top picturebox. But the picturebox's location changes off to somewhere off screen which is what I don't want.
If there is nothing like that, then are there any suggestions?
Currently I'm working with very small pictureboxes and I've tried everything to get the top image to be in the same place, including things like this code:
Btn_Close2.Location = New Point(Btn_Close2.Location.X - Btn_Close.Left, Btn_Close2.Location.Y - Btn_Close.Top)
But the top picturebox just wonder's off somewhere.

Size of Form is messed up after disabling control box with Custom Location

I did some research and could not find anyone even mentioning the problem I'm having, if I set up a form in c# and compile the application it looks and works perfectly fine, but when I disable the control box the size of the form seems to shift and everything is messed up, but ONLY while the program is running, it looks perfectly find and normal in the gui builder.
I've had the issue for a while and I usually get around it by making the form bigger and testing until it looks right, but it's somewhat annoying and I was hoping maybe someone else has a better solution?
EDIT: I moved some things around and anchored the EXIT button to all 4 sides to better show the difference in outputs between the two settings
EDIT2: I have found that this ONLY happens when using a custom location (IE location != 0, 0)
EDIT3: In my project it gets SMALLER and the formborderstyle workaround doesnt work as it did in my test project
VIDEO: https://www.youtube.com/watch?v=L5v2y5YCHio&feature=youtu.be
I also found that setting FormBorderStyle=Fixed is a possible work around for now, I have opened a bug report on visual studio's site to see if we can get this fixed!
I'll update if anything new comes up
WITH control box:
WITHOUT control box:
There is a bug in visual studio that relates to custom form locations and the control box, generally setting the formbordersize = fixedsingle will solve this, however in my case I was changing the location in code during form initialization:
InitializeComponent();
this.Location = new Point(w.Location.X + (w.Width / 2) - (this.Width / 2), w.Location.Y);
By changing the code around (reversing) as so:
this.Location = new Point(w.Location.X + (w.Width / 2) - (this.Width / 2), w.Location.Y);
InitializeComponent();
This issue was resolved, I don't know exactly what causes this, nor why it is fixed, technically the initialize component has a location set in it that should override my location, but it works for me.
I will not accept this as an answer, someone that can explain it better, in more detail, why or how it works, I will accept THAT answer.
Thank you for your time!

Imagebeforetext does not center button contents

I'm using Windows Forms.NET.
I've configured a button in the following way:
ImageAlign: MiddleCenter
TextAlign: MiddleCenter
TextImageRelation: ImageBeforeText
The problem is, when I make button wider than usual, its contents are no longer centered:
Why is it so? How can I correct it?
I think the Text and Image share 2 even parts of the Button Client area horizontally. So if you set the TextImageRelation as OverLay, ImageAboveText, TextAboveImage they should be what we expect. But for other values, they act differently. I think that's by design.
To solve your problem, I have tried changing ImageAlign to MiddleRight and it works as what you want.
Again, I think that's by design. :)

Animate a sprite by using two images

I would have thought this was a common desire, but I'll be damned if I can find this.
I simply want to Animate an image by swapping two images back and forth. I tried StoryBoard, but apparently you can't change the source in a storyboard. The only answer I can come up with is a Timer, which I don't think is the best way.
Edit: How do I animate image content in WPF? Came up in the "Similiar Questions" window. And while this will do what I want, it is "hackish" as the OP of it says, and it only swaps two images, what if I wanted a whole sequence of 10 or 20 or 100.
I found another post here on SO whose answer sounds like it could solve your problem: Change an image during animation using storyboard
The problem with this approach is that it also doesn't satify your request for supporting an arbitrary number of images.
I was going to propose a different method that involves databinding the Image Source to the image path, and then in code behind simply changing the path, but I haven't gotten it to work yet.
Here's an article that seems to have an elegant way to handle your requirements: http://www.codeproject.com/Articles/364529/Animation-using-Storyboards-in-WPF
Hopefully that will work for you.

Categories