Windows Form Size changes at run time automatically - vb.net

I am developing an project in VB using .NET and One of my form is resizing it self at runtime. My other form are perfect but only my one page, which I made is a login page, gets resize at runtime.
My configuration

If you don't want the form to be resized, try setting the AutoSize form property to False.

Related

Is there a way to hide all panels in windows forms using vb.net?

i was wondering if it was possible to hide everything at once in windows forms, i was planning to use a drop down which made things appear and disappear but i wanted everything hidden at the beginning for simplicity.
Thanks!
On the form, add a Panel control (found in the Containers section of the toolbox).
Set the Visible value of the Panel to be False.
Add all controls inside this panel. You can then make the panel visible and hidden via code. (no need to cycle through all controls on the form)

Display controls in Designer VB.Net 2013

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.

.net cf unwanted gray borders on controls if form is disabled

I am trying to implement a non blocking message box and what I do is I call another form's show method and disable the main form. However, I noticed that there are gray boxes on the form when i disabled the main form. I am currently using .net cf 2.0. Is there a workaround to avoid this?
The showdialog works fine and i dont see that gray lines however, it is a blocking method.

Reducing redraw flickering on vb.net web application

I have a page on my web application which has a chart that gets retrieved using a timer. Is there a way to avoid the flickering everytime the chart is redrawn?
Since It's a web application, I guess the doublebuffer property isn't available, or at least I didn't find it and assumed it's webform related.
I would appreciate any help in the matter.
A quick and easy but not suggested solution is to call the redraw manually and remove the event.
So you would remove the event handler and you call the function that redraws the chart when you think is required. i.e After the resize is done or after a value is changed etc.
Since it is a web application, I guess the redraw you are talking about is made using a browser page refresh.
If so, you should take a look at Microsoft Ajax Framework, and a UpdatePanel control to just refresh the specific chart part of your page. Should be smoother then.
http://www.asp.net/ajax

Reload/refresh page after postback. SharePoint, Visual Web Part (Sandboxed)

I have a visual web part (sandboxed) that visualize a form for adding sub-sites. When a sub-site is added its added in the navigation and in a DropDownlist (for delete purpose...).
My problem is that after post-back everything works fine, except i have to manually reload the page to see the new changes (both nav. and dropdownlist). Note that neither Response.Redirect or UpdatePanel will work i a sandboxed-solution.
Anyone got a solution to this problem?
When you perform a postback, your browser submits the contents of all web controls to the server. The server is stateless in this sense; the state of the control is actually stored in your browser. I would say your problem occurs because the web controls are not populated from SharePoint object model. Instead, the server uses the data received as the postback. Alternatively, the population might even happen, but the postback data will overwrite the contents of controls.
The solution is to refresh control data after the controls have been populated from the postback data. You could do this, for example, in the method OnPreRender. When OnPreRender is called, all the postback data has already been processed.
Try to add the following code in your webpart class.
protected override void OnPreRender(EventArgs args)
{
if (this.Page.IsPostBack)
{
// Repopulate controls here
}
}
The problem of this is, of course, that repopulation will kill the previous (postback) state of the controls. So, if you want to preserve the current value of a control (such as a dropdown selection), you must save it before repopulation and restore it manually.
To learn more about the page lifecycle in ASP.NET, see ASP.NET Page Life Cycle Overview.