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
Related
I have some old vb.net forms (can't find out which version they were using when they made them), and I can't find the form's Width and Height in any of the files.
The forms don't have a .designer.vb file, and it's not in the .vb "Windows Form Designer generated code" section either. However, when I open the form in the design view, I can see the values perfectly in the Properties tab.
I've tried making a file search for the values independently but there are nowhere to be found.
Any suggestions or ideas?
I have googled for some time but I can't find anything that helps.
After some tests, I'm quite sure the value comes from the sizes of everything else it has inside.
The form has various Group controls that "force" the Form's size, and therefore, there's no need to stablish it manually. If I do so, the values appear as usual, but otherwise, they are not stored anywhere.
I have a set of controls which are added dynamically to a panel. The number of controls depends on which tab a user selects from TabPage control, which is embedded in a form.
At the moment, the controls don't appear in Designer, but appear during execution.
I managed to display controls for other forms which are not dynamic by moving the non-design code to the vb file, but how can I display the other ones?
The only answer that I know of is to add your code in the .Designer.vb file of the Form.
BUT! I strongly advise you to avoid that if you are not sure how it works! Custom code in the .Designer. files can break your form design and project with possible random crashes.
Also, your code can be changed and removed by the Visual Studio designer:
Custom code in designer.vb file goes away when making edits in design mode
Instead, you can make the panels into custom user controls and add those to the tabs.
I'm making a custom control in VB.net 2008 Express. Without getting into the details, I am able to duplicate the issue as follows:
Make a blank custom control. Stick two textboxes on it. Don't add any code.
Run it and click the second textbox. (Don't click the first.) The text cursor appears of course.
Now Type... Although the text cursor moves within the second textbox, the text you type appears in the first textbox, not the second one.
I have found that this issue depends on the tab order of the controls. Whichever textbox is first in the tab order gets text typed in the other.
I have also found that if you press [Tab] to set focus on either textbox, the problem goes away.
QUESTIONS:
1) Is this a known bug in .net? (Specifically 2008 Express)
2) Will this phenomenon carry over when the custom control is brought into a larger project?
I followed the steps above and was able to reproduce it when I started with a Windows Form Control Library and ran it inside the UserControl TestContainer. I test this in Visual Studio 2008 Professional.
However, when I placed the user control inside a form in a separate Windows Forms Application project, the issue did not occur. So I'd think it's safe to say that this won't be an issue when the user control is used in another project.
I have a user control that looks like this in the designer:
However, when I close the designer and open it again, it looks like this:
The eight controls that have moved are text boxes and labels that are all set to Anchor Top, Right while all the other controls have different anchoring.
Does anyone have any idea what is causing this change of layout, and more importantly, how it can be prevented?
I also had the problem of changing the layout of my form every time by opening it in design mode.
The problem was the use of the tool "TableLayoutPanel".
By coincidence I found that changing the property "Dock" solved the problem.
Just set to another value and then undo this.
After this is seems to be solved. Don't ask me why!
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!