This is a discussion on Practical issues when we develop code in Windows Forms in C#.Net 2005 within the C# Programming forums, part of the Software Development category; Here,I would like to discuss the basic problems or issues that we face when we code in the Windows ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Here,I would like to discuss the basic problems or issues that we face when we code in the Windows Forms?
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| Sponsored Links |
| |||
| Hi Deeban, Use the form's WindowState property for minimizing and maximising the forms. //minimize this.WindowState = System.Windows.Forms.FormWindowState.Minimized; //maximize this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi , You can listen to the Form's Closing event, where you can display a MessageBox as show below: [C#] private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (MessageBox.Show("Do you want to close the application?", "Close Application", MessageBoxButtons.YesNo) == DialogResult.No) e.Cancel = true; } [VB.NET] Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) If MessageBox.Show("Do you want to close the application?","Close Application",MessageBoxButtons.YesNo) = DialogResult.No Then e.Cancel = True End If End Sub
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi sathish, You know the apearance of the form and controls plays a major role in the applications.So,I need to know How to center my form?Could anyone help? |
| |||
| Hi Deeban, Yes.You are absolutely right.You can set the Form's StartPosition property to CenterScreen to achieve this.
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi sathish, I tried your idea.Its working.Now I am overcoming another doubt.When we resize the form,the whole arrangement of controls gets collapsed.So,I dont want to allow users from resizing my forms.Do you have any idea how to do this? |
| |||
| Hi Deeban, You can prevent the users from resizing your form by setting the FormBorderStyle to FixedDialog and setting the MaximizeBox property to false.
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi Sathish, I am a newbie.And the first thing that strikes me to learn the display and appearance of the application.Thats why I am asking a lot of questions on this one.ok How do I programmatically set an image as Form's Icon ? |
| |||
| Hi Deeban, You could do so as shown in the code below : [C#] Form form1 = new Form(); Bitmap bmp = imageList1.Images[index] as Bitmap; form1.Icon = Icon.FromHandle(bmp.GetHicon()); [VB.NET] Dim form1 As Form = New Form() Dim bmp As Bitmap = imageList1.Images(index) as Bitmap form1.Icon = Icon.FromHandle(bmp.GetHicon())
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL 2005 Installation issues Error (0xc0000005). | nnraja | Server Management | 2 | 10-29-2007 01:05 AM |
| Windows Forms Patterns | Mramesh | C# Programming | 0 | 09-25-2007 09:13 AM |
| Windows Forms from MFC | Sundaram | C# Programming | 5 | 09-25-2007 09:09 AM |
| Windows Forms Mouse Handling | Sundaram | C# Programming | 3 | 09-25-2007 08:51 AM |
| Pratical issues in adding controls to Windows Forms in C#.Net 2005 | Sathish Kumar | C# Programming | 21 | 09-22-2007 05:11 AM |