.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Resize forms, textbox and buttons

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :Windows Application


I have a application with more then 100 forms, designed in 800 x 600 resolution, without anchors and dock. Now I my clients want use the application in 1024 x 768.

How can I resize and reposition my controls (just: textbox, combos, buttons and gridviews), without using anchors and dock?

I looking for a method or control like a known vb "Resize_For_Resolution". I found a control named ".Net Resize" but is not free.




View Complete Post

More Related Resource Links

Possibly Severe Bug in Windows Forms / TextBox / RichTextBox, Windows Freezing

Problem: Windows Message Processing (in all running apps) completely freezing periodically for about 10 seconds when using certain combination of Forms properties on a form with a TextBox/RichTextBox. This behaviour might not be limited to the two controls. The weird behaviour starts with but is not limited to scrolling text in the textbox with the mousewheel. Using: Visual Studio 2008, Visual Basic, compiling for .NET Framework 3.5 (Any) OS: Windows XP SP3 Reproduce: Open new project, add a new form named TestForm, add a TextBox named TextBox1, enable scrollbars on the TextBox. Add the following function to the form: Public Class TestForm     Private Sub TestForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load         ' CONDITIONS WHEN STARTS TO SLOW DOWN:         ' Form.Opacity < 1.0         ' Form.BackColor = Form.TransparencyKey (= whole form is transparent)         ' this makes the form completely transparent         BackColor = Color.Red         TransparencyKey = Color.Red         ' NOTE: when this is set it starts to slow down         Opac

Problem with overriding OnPaint method of System.Windows.Forms.Textbox

Hi,   I want to change the border colour of the Textbox. However, when I override the OnPaint method, some strange behaviour occurs.   The new border is drawn, as is the textbox background. However, the text itself appears in bold and only while I actually type something in, afterwards it disappears. I have provided a sample of my code here:         protected override void OnPaint(PaintEventArgs e)         {             base.OnPaint(e);             Rectangle rect = new Rectangle(0, 0, this.Width, this.Height);             ControlPaint.DrawBorder(e.Graphics, rect, _BorderColour, ButtonBorderStyle.Solid);         }   I have also set the style of the control to Userpaint, so that the paint method is actually used. Does anybody know how to solve this issue?

Set dropdown width of a textbox with AutoComplete in windows forms



I have used a Textbox control along with its AutoComplete feature by using AutoCompleteMode,AutoCompleteSource and AutoCompleteCustomSource properties.

Everything is working fine i.e. on typing letters dropdown list shows the related matching list of values.

However, I am not able to set the size of dropdown list programmatically.  I can increase the size(preferably width) of dropdown list at runtime.  But, as AutoCompleteCustomSource is getting reset everytime the textbox gets focused, dropdown list width also gets reset to the width of the textbox.

Just like the feature of Combo to set DropDownWidth programmatically (or say at design time), is there any way to set dropdown width for a Textbox having AutoComplete feature.

My Code for the reference (On Form Load event) :

        TextBox1.AutoCompleteMode = AutoCompleteMode.Suggest

How to disable resize grip on multiline textbox?


I cannot seem to find what should be a simple setting to keep my multiline textbox to the height/width or row/column settings without the resize grip or ability to resize. How do I prevent resizing?

Textbox Editable GridView in ASP.NET

This article describes how I made a fully editable gridview in C# using ASP.NET 2. The idea is that the GridView looks and works like an Excel spreadsheet. You see all the cells in the table, and you can edit any of the cells you like, and they are automatically updated (i.e. saved to the database). This is very often how people expect data tables to work in web pages, and I've often seen people clicking in vain on un-editable gridview cells, somehow expecting to edit them, and not understanding that they need to click an Edit button at the end of the row.

Highlighting Rows with TextBox OnFocus

In another article I explained that how you can make the rows of the GridView control clickable and highlight them when they are clicked. In this article I will explain that how you can highlight the GridView rows when you focus on the TextBox which is contained inside the GridView control.

Routing for Web Forms in ASP.NET 4.0

posted a prototype demonstrating how one could use Routing within Web Forms. This is something you can do today with ASP.NET 3.5 SP1, because of the work we did to separate Routing from ASP.NET MVC. I would have liked to include Web Form Routing as part of the Routing feature when we were working on SP1, but we didn't have the time to do so in a robust manner before SP1 was locked down.

Gridview with Radio Buttons

As now, Radio buttons are HTML controls, I am not able to get it on server side. When user select any radio button and press submit, Control will not available at code behind, you can use "e.Item.FindControl" as it is not "runat='server'". I want ID "Primary Key" value for selected radio button. To achive this I took the help of Javascript. I wrote javascript function that sets the values of "Primary Key" in hidden field when user clicks on any radio button. Now when user clicks on Submit button, user can get selected value froim hidden field.

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

Explained: Forms Authentication in ASP.NET

This module explains how forms authentication works in ASP.NET version 2.0. It explains how IIS and ASP.NET authentication work together, and it explains the role and operation of the FormsAuthenticationModule class.

Using Forms Authentication in ASP.NET - Part 1

Classic ASP developers often had to "roll their own" authentication scheme, however, in ASP.NET much of the grunt work has been taken out. This article outlines how things have changed and how FormsAuthentication can be used to secure a Web site with a minimal amount of code.

ASP.NET Forms Authentication - Part 1

Often, in legacy Web applications, users authenticate themselves via a Web form. This Web form submits the user's credentials to business logic that determines their authorization level. Upon successful authentication, the application then submits a ticket in the form of a cookie, albeit a hard cookie or session variable. This ticket contains anything from just a valid session identification access token to customized personalization values.

ASP.NET forms authentication with roles

.A timeout is specified in minutes. This is "time since last request" not the "time since login". If a login is indicated to be persistent (described later) this is ignored.
.A protection method is specified for the cookie.
Next I wanted to specify a folder to which access is restricted to people who have logged in. To do this I entered the following code in the web.config file (beneath

Forms Authentication in ASP.NET

In this tutorial you will learn about Forms Authentication in ASP.NET 2.0 - Forms Authentication class, Cookie Domain, Forms Cookies, The Login Control, Signin, Signout, Authenticate, Redirect, Login Status, Login Name and Login View Controls.

Determine whether Forms Server is installed on a server

Check whether the Microsoft.Office.InfoPath.Server.dll and FormServer.aspx files are installed on the server.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend