How do you remove the white box behind a chart series label? - vb.net

Is there is a way to remove the white box around the series label in a chart. I am using the built in chart from the toolbox in Visual Studio 2010. This is the last part I need to finish the appearance of the chart to make it look the way I want. Please help.

I don't see the white box you are describing, but to change the properties of that section of the chart, click it in the designer, go over to the Properties window on the right, and scroll down to Legends.
Once there, hit the [...] button next to it, and that will bring up the set of all of the legends. Select the legend you want, and adjust the BorderColor property to the background color. I didn't see a means by which you could turn the border off, nor does it seem like you can set the width of the border to 0.
These can also be set programmatically, like Chart1.Legends(0).BorderColor = Color.White

Related

Modify Z-index on Series object in Excel 2010

I am using excel 2010.
I have a chart diagram on which i put a rectangle to surround the highest column bar.
In order to make things more readable, i would like to place this rectangle on the chart but NOT in front of the lines/bars/etc...It has to be behind them.
Shape objects (like my rectangle) have a ZIndex property than can be modified in order to achieve that. Thing is, it seems impossible to put that behind the elements of my chart, nor the chart itself.
The main reason is because Chart objects and Series objects (which are the columns inside my chart) doesn't have a Z-Index property.
Is there a way which could allow me to achieve this ? Other than modifying ZIndex property ?
You can move the Chart in front of the Shape, or the Shape in front of the Chart. But what you are looking to do is to stuff the Shape behind some components of the chart, but still in front of the chart background.
That, as far as I know cannot be done.
But you can simulate the effect by making the Chart's background and the Plot area transparent (no fill, instead of the default White fill) by simply right clicking and adjusting properties.
Also, you can highlight both the chart and the shape (Ctrl-Multiple Select) and lock the two together so your Shape will look like it's a part of the chart and is behind the components.
Of course, the shape will be behind the whole chart itself (by setting the appropriate Z-value, which you may find by simply clicking on Record Macro and running the formatting once to get sample code) but since the chart's background is transparent and so is the plot area's it'll look as if the rectangle's behind the lines and all.

WinForms SplitContainer and its spacing and resizing

I seem to have a lot of trouble getting a SplitContainer adjusted the way I like it. I have the following form called frmMain:
In the form Load code I have to following code:
With MainContainer
.IsSplitterFixed = True
.Dock = DockStyle.Fill
.SplitterDistance = 200
.FixedPanel = FixedPanel.Panel1
.Panel1.BackgroundImage = Resources.My.Resources.ResourceFile._001
.Panel2.BackColor = Color.White
.Panel2.AutoScroll = True
End With
When I run the code I get the following:
I want to remove the gray splitter since there is no use to it. Is this a common beauty
bug and is it possible to remove it?
My second problem with the SplitContainer is if I resize my window, the backgroundImage in Panel1 and the white color in Panel2 don't adjust with the window. I searched high and low to the Resize code but I can't find it. The Panel2 has User Controls, eg. Dashboard and are loaded this way: MainContainer.Panel2.Controls.Add(Dashboard).
Is it also possible that Panel2 automatically adjusts to the weidht of the window so thay you only have a hortizontal scrollbar?
Thank you for reading my question and hopefully you can help me solve my problems with the SplitContainer. Have a nice day.
I want to remove the gray splitter since there is no use to it. Is this a common beauty bug and is it possible to remove it?
If you don't want the user to see or move the splitter, why use a split container? As an alternative, consider using a TableLayoutPanel configured with 1 row and 2 columns. The first column would be an absolute 200 px wide while the second column would be set to 100% wide. In each of the two cells, you could place a panel which is docked and set to have a margin of 0,0,0,0.
My second problem with the SplitContainer is if I resize my window, the backgroundImage in Panel1 and the white color in Panel2 don't adjust with the window. ... Is it also possible that Panel2 automatically adjusts to the weidht of the window so thay you only have a hortizontal scrollbar?
While I did not mock up your current solution, I was not able to replicate these problems with a quick mock up of the solution I proposed above. With regards to auto-scrolling, the only reason that scroll bars should appear would be if a control is off the edge of the screen or the available screen space is less than the minimum size of the panel.
You have 2 options:
Use TableLayoutPanel (as #erdomke suggests)
Use 2 Panel controls
For 2 panel controls, dock panel1 to Left, and dock panel2 to Fill. To fill panel2 with a UserControl that resizes, set it's Dock property also to Fill.

XAML Theme Brushes - Switching Dynamically, cursor doesn't change

First Off, I found this extremely useful page on theme brushes:
http://metro.excastle.com/xaml-system-brushes
So Roughly, on startup for WinRT/XAML I am setting my theme brush for a textbox in a stylesheet:
Foreground = TextBoxDisabledForegroundThemeBrush
Background = TextBoxDisabledBackgroundThemeBrush
Which at run time makes the textbox appear as: white border, transparent background and grey text. Which I was hoping it would make it transparent, white border and white text.
On my Tapped event, I change the textbox to:
Foreground = TextBoxButtonPressedForegroundThemeBrush
Background = TextBoxButtonPressedForegroundThemeBrush
Which is supposed to be black background, white text and white border. Which seems right, but the cursor is back and you cannot see it.
First question is, am I doing this right to change my text color? I want to change the textbox so once it is selected it stays a changed color. I think this is correct. But I am not sure if I should be setting Foreground or maybe a Font Style instead?
Unfortunately you can't change caret color so if you want your TextBox editable - you should keep the background white or otherwise light. Otherwise, controlling the look of your control in its various states is best done using VisualStateManager and that is easiest to manipulate using Blend.

White square on top of the form?

I'm trying to display a white square in the upper part of a form but I have not the slightest idea how.
Like This:
Do this:
Drag a Panel control onto your form from the Containers section in your designer toolbox
Set the Dock property to Top
Resize it so it's as high as you want it
Set the backgorund color property to White
This is just one of a number of different ways that this can be accomplished. What do you plan on doing with this white area of the form?

Decrease the Space Between a Menu Item's Icon and its Text

In my .net windows form (I am using XP Pro SP3 and VS 2010), I have created a menustrip. In the menustrip are several menu items, each with a dropdown menu. The menu items in the dropdown menus each have an icon with some text. I want to make the menu more compact by decreasing the horizontal space between the icon and the text. (I added a red arrow to the picture to show the space I am talking about).
So far, I have set the padding of all the menuitems to 0, but this seems only to affect the vertical spacing between one menu item and the next.
I want to use the system rendermode for the menustrip (although the problem persists no matter what rendermode I use. The icons in the menu are 16x16, and have the property sizetofit.
Funny thing is that this very same spacing is just the way I want it in the menustrip - the icon is right next to the text.
This will remove the image margin completely, but it removes the images too; I just want to change the width of the image margin.
For Each menuItem As ToolStripMenuItem In menu_main.Items
DirectCast(menuItem.DropDown, ToolStripDropDownMenu).ShowImageMargin = False
Next
What can I do here?
So, this is kinda cheating, and probably isn't going to look as clean as you'd like, but I was able to do it by making the image have the text and then setting following properties in the designer for the menu item:
DisplayStyle = Image
ImageScaling = None