Adding an image to 1 of the tabs on a TabControl, blocks my tab's text - vb.net

Using Visual Studio 2005 (vb.net) (windows forms) on Windows XP, I have a standard Microsoft TabControl.
A button click adds/removes an image from 1 of the Tabs.
Seems like the image is placed OVER my tab's text, making it unreadable.
Why isn't it like it should be: Image on the left. Followed by text on the right.
Why is the image being placed OVER my tab's text? Do I need to do some kind of "refresh" or "redraw" before it will appear as it should?
I don't see any way to "make the image appear on the left edge of the tab". (NOT the tab-page.) ... and then place the text just to the right of the image. (Just like a normal image+text tab can do.)
The code is pretty simple, it just gets an image from my ImageList:
cfgTab.ImageKey = "PadLockClosed.png" ' Show CLOSED PadLock
The tab's text changes from:
This is my tab text
to:
T(IMAGE HERE)is my tab text
The image appears OVER the beginning of my text. But if I move to another tab, then move back, the image appears in the correct position:
(IMAGE HERE) This is my tab text

You can use docking and anchoring on your Control property so it will be placed according on what you want it to display.
Manage WinForm controls using the Anchor and Dock properties
Resizing a Single Control In WinForms
Regards

Related

Devexpress Form With Header Panel (Title) and Menu Below Panel

Can someone give me insight how can I achieve the form with panel title first and then menu bar below panel (barmanager). Because devexpress always put barmanager on top
Thank you
EDIT :
After I add standalonebardock, the result as picture shown below: the red bar is standalonebardock
UPDATE :
After I drag the barmanager menu into standalonedock, now it is already inside the dock. But the menu still on top docking, what I need how to make space above menu so I can write title/image/etc
The StandaloneBarDockControl control allows bars to be displayed at any position within the form, not simply docked to the form’s edge. To do this, create a StandaloneBarDockControl object and add bars to it. Bars can be added to the control at design time or runtime.

Using vertical scroll with tabcontrol

I am using Visual basic 2010 for coding. I have develop the code on desktop. Where I have adjusted form as per my desktop screen. I am going to run the application on Laptop. When I run the app the screen is not fitting to Laptop screen. SO I deciede to include vertical scroll. If moved up and down we can see all the parameter.
How can I do it?
I have added image for reference.
The scroll bar(s) should be inside the individual TabPages. You should set the Anchor and/or Dock properties of the TabControl so that it resizes with the form and set the AutoScroll property of each TabPage to True if you want it to display scroll bars if and when any of its child controls are outside its viewable area.

Yosemite Toolbar Style

How do I get the new toolbar item style of OSX Yosemite?
I created a standard toolbar, but the buttons don't have that button-like look. Do I need to drag actual buttons to the toolbar to get this look?
What I have:
What I want (that round bezel and white background):
There are two types of items in toolbars, image items and view items. It looks like you have an image item. You seem to want a view item where the view is an NSButton configured as a round textured button. So, yes, you should drag actual buttons to the toolbar.
I would not attempt to control the button background. You should use the button as-is to get the default system appearance. Apple recommends using a PDF template image (all black with the alpha channel used to make the image). The button itself would not have a title/label. Rather that would be on the containing toolbar item.
It looks like you may have applied an internal blue "glow" or highlight to your image. Generally, you should not do that. Let the frameworks apply appropriate effects to the template image automatically based on the button state and shows-state-by mode.
Toolbars in the Human Interface Guidelines
Controls which are appropriate to use in the window frame (including the toolbar)
Designing images for toolbar buttons
Works just fine for my Cocoa app under Yosemite -
are you actually setting the template property for your icon images..?
From the NSImage docs:
The 'template' property is metadata that allows clients to be smarter
about image processing. An image should be marked as a template if it
is basic glpyh-like black and white art that is intended to be
processed into derived images for use on screen.

Is control location relative to visible area of form when form has scroll bar?

I have a VB.NET form that dynamically creates a set of controls. If there are too many controls to view on the form, the form will show a scroll bar. (It is an autoscroll form.)
The user can scroll down and click a button which causes the form to change dramatically. It destroys all controls and draws new ones based on user input.
I've noticed that if the user is scrolled to the bottom of the form and click the button, when I destroy and create new controls they aren't located where I want them. It seems to put them relative to the visible portion of the form rather than the top of the top.
Example:
checkbox1.top = 50
checkbox1.left = 15
If the scrollbar is all the way at the bottom, the checkbox should be placed above the visible part of the form. Instead, it is drawn 50 pixels from the top of what I can see.
Please help. How do I make it place the control at an absolute location, rather than being relative to the current position of the scrollbar?
You have to compensate for the scroll position of the container control.
If a panel, then it would look like this:
checkbox1.Top = Panel1.AutoScrollPosition.Y + 50
Alternatively, you could just use a FlowLayoutPanel control, which would handle the placement of the controls for you.

Draw a line above a docked control

I have a borderless form that I'm "docking" onto the top edge of my screen. Inside of the form, I'm placing a single toolstrip control, which docks across the entire form -> (picture the taskbar to get an idea of what I'm talking about).
Because the borderless form has no edge to it, I wanted to draw a black line along the bottom edg` of the form to differentiate the form from the windows or desktop behind it.
The problem that I'm facing is that`the toolstrip will not move "behind" the line when it's docked, no matter how I order the control layers.
I've tried programatically sending the control to back to no avail either.
Any ideas on how to get the line to show above the docked toolstrip?
Dock another control to the top that displays like a black line (e.g. a Label with a black background and a height of 1). Insert your ToolStrip after you have docked the Label. It will dock just below the Label.