VB.Net / Winform - draw a line? - vb.net

I'm using visual studio 2010 and vb.net.
On my form I have an Group Box that I use to visually segment various controls on the form.
My question is how can I add a horizontal line that looks the same as the border lines of the Group Box?

Jonathan is a heckofalot closer then he might have thought. Add a GroupBox, set the Text property to an empty string, change the Size property to make the Height equal to 2. Presto, horizontal carved battle-ship gray line like seen on many dialogs.

My preference would be to use a group box, as this is more standard.
If you need something custom, use write your own Paint handler to paint whatever you need.

I'm not sure how an option box would visually segment controls, but have a look at the LineShape control in the Visual Basic PowerPacks (from Microsoft).
(Google "Visual Basic PowerPacks", download it from MS, then install it.)

Related

fix form size in visual studio

I am trying to design a web form in visual basic and i have a problem.I put all the elements(buttons, labels etc) in the place i want.When i run the form i have the option to maximize the screen of the form and when i do this,a blank space appears in the form where there are no elements and all my elements are shown to the left upper side of the form. I can't see that blank space when i am designing the form. Could you help me how to fix the fix the size?
I tried autosize,autoscroll and size properties but i didn't fix the problem.
You don't specify whether it's VB6 or VB.Net but for once, it doesn't matter much.
Look at the form property BorderStyle, and change it to one of the "fixed" options.
VB6 documentation
VB.Net documentation

Shapes control in vb.net

Is there anything like shapes control of VB 6.0, in Vb.Net?
I need to draw lines etc. at design time. But I could not find any shapes control in the toolbox.
Thanks
Furqan
Microsoft released the free Microsoft Visual Basic Power Pack that contains Line and Shape controls that you can add to the tool box. A post here suggests it is included in VS2008 SP1 so you may already have it.
Alternatively you can create your own using a panel and override the onPaint event.
no built in controls but you can easily achieve the same goal with some API calls: http://msdn.microsoft.com/en-us/library/bbw12xs4(v=VS.90).aspx

ReportViewer: two text colors, one cell

Is it possible to have 2 areas of text in one cell such that each can have a different color? You can do this in crystal reports but I cannot see a way to do this in ReportViewer. What it is doing is essentially highlighting an important text fragment if it appears in a cell description to draw the users attention. I am fairly new to reportviewer so it for now I am assuming it's my lack of knowledge that is making this difficult. I am using VS2010.
Thanks.
Turns out VicarlnATutu wasn't quite right.
You can do this, but only if you are using VS2010 (which I am) because it includes the new SSRS rendering engine for SQL-Server 2008. This allows you to put some basic HTML into a field and have multiple formats in one cell. For more info see below:
http://msdn.microsoft.com/en-us/library/cc645967.aspx
http://msdn.microsoft.com/en-us/library/cc627491.aspx
One thing that tripped me up is what they call a 'placeholder' in the MS documentation is the little bit of text inside the textbox control that shows up by default. You can select two different things on the control in VS2010. One is the textbox itself. Right clicking on the textbox gives you 'text box properties'. The other thing you can select is the default text INSIDE the textbox. Right clicking on this 'placeholder' text gives you a different context menu where you can select 'placeholder properties'. This is where you can change the cell to accept HTML.
No, unfortunately not. I don't know if there are custom controls out there for ReportViewer, but the built-in TextBox only supports setting color (be it Foreground or Background) for the entire thing.
ah, good to know. kind of a unintuitive way to tell a TextBox to display HTML, but nice to know that you can!

VB.NET - Ribbon Shows Black Area

I need help with my vb.net program. I've added a ribbon bar to the top of my main form using the DotNetBar and the problem is that it shows a black rectangle area instead of the default blue color. This only happens when I am using Windows 7 aero and is not maximized.
Anyone have any suggestions?
Just a guess, but it looks like DotNetBar is meant to be used without the standard Form chrome. Try setting your form's border style to None.
Also, make sure you're following the directions and using a DotNetBar form control:
http://www.devcomponents.com/kb2/?p=703
Hope this helps!

VB.NET forms behave strange on design-time

I'm developing with VB.NET 2008.
One of my host was crashed, so I take the files and keep development on another host. But now something strange is happening:All frames, lines and shapes are disappeared on design-time, but are seen normally in runtime.
Please see the attached screenshot (Upper is design-time, lower is runtime).
http://gomidjets.com/forms.JPG
How do I fix this?
Update:
The shapes are GroupBox and LineShape. LineShape is part of "VisualBasic PowerPack" indeed.
If I try to add a line shape, it is added but invisible in the designer, while it's visible during the run-time.
Any idea?
If i was you i'd most definitely check the zorder.
As a last resort take the controls out of the groupbox and recreate the groupbox.
Also if you add a groupbox or a lineshape control on another form,does it work? if they do,you should check your code