Click here to Skip to main content
15,889,096 members
Everything / Forms

Forms

forms

Great Reads

by Member 4206974
FormGen, a JavaScript Form Generator
by Cristian Moldovan
jQuery unobtrusive validation plugin with Twitter Bootstrap 3 showing error messages as tooltips
by Jean Carlo S. Passos
CRUD over Association Entity that maps to association tables
by SREENATH GANGA
Auto updating the exe if the latest exe is available in the network share

Latest Articles

by Member 4206974
FormGen, a JavaScript Form Generator
by Ev Uklad
Developing applications based on Flows, Forms, and Rules using type-safe advantages of C#
by Ev Uklad
Developing applications based on Flows, Forms, and Rules using type-safe advantages of C#
by Ev Uklad
Developing applications based on Flows, Forms, and Rules using type-safe advantages of C#

All Articles

Sort by Score

Forms 

4 Aug 2013 by Joezer BH
See Crystel Report Error in VS2010[^]A solved question linking to the following suggestion:when u received this kind of error:"Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI...
15 Jan 2024 by Member 4206974
FormGen, a JavaScript Form Generator
21 Jul 2014 by Cristian Moldovan
jQuery unobtrusive validation plugin with Twitter Bootstrap 3 showing error messages as tooltips
4 Apr 2015 by Jean Carlo S. Passos
CRUD over Association Entity that maps to association tables
27 Jan 2015 by SREENATH GANGA
Auto updating the exe if the latest exe is available in the network share
5 Jan 2016 by OriginalGriff
Create a UserControl.The way I did mine was to have a "coloured"image and a "monochrome" version of the same picture, and then paint the appropriate parts of each so that the initially monochrome image changed to full colour as the progress completed, but it would be pretty simple to just draw...
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
23 Nov 2011 by Sergey Alexandrovich Kryukov
First of all, you did not add an instance of calendar to anything. The method Show is just irrelevant. It's the antonym of Hide. You only need to call Show for forms. What you need is adding:MonthCalendar MonthCalendar = new MonthCalendar();Panel PanelCalendar = new...
26 Mar 2012 by ProEnggSoft
I think the following Code Project articleWinforms SkinFramework[^]may also be helpful.
3 Oct 2015 by Mr.PoorEnglish
what is "typed" on typed Dataset, and how to use it
20 Mar 2016 by Afzaal Ahmad Zeeshan
In this episode I am going to talk about using graphical applications in Mono. The graphical framework to use would be Windows Forms.
17 Mar 2011 by JF2015
This code closes the form after 10s:System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();private void Form1_Load(object sender, EventArgs e){ timer.Interval = 10000; timer.Tick += new EventHandler(timer_Tick); timer.Start();}void timer_Tick(object sender,...
25 Mar 2012 by JF2015
The correct approach to a different color of the title bar would be to apply a skin to the whole form. There are several toolkits for .Net that do that for you e.g.http://www.skincrafter.com/[^]http://www.devexpress.com/Products/Index/themes.xml[^]
24 Apr 2015 by Sergey Alexandrovich Kryukov
Please see my comment to the question.Please see my past answers:Append a picture within picturebox[^],draw a rectangle in C#[^],How do I clear a panel from old drawing[^].Other problems could be solved as you face them, but it's still better to make a good plan.—SA
1 Oct 2015 by Steve Aube 1
This article describes a new alternative approach for Automated Testing of User Interfaces (UI).
17 Mar 2011 by OriginalGriff
Yes.Timer formClose = new Timer();private void myForm_Load(object sender, EventArgs e) { formClose.Interval = 10000; formClose.Tick += new EventHandler(formClose_Tick); formClose.Start(); }void formClose_Tick(object sender, EventArgs e) { ...
6 Apr 2011 by Not Active
You tried something like this?private EventHandler onMyEvent;public event EventHandler MyEvent{add{Foo();onMyEvent = (EventHandler)Delegate.Combine(onMyEvent, value);}remove{Bar();onMyEvent...
4 Jul 2011 by PSK_
Have you checked this?http://msdn.microsoft.com/en-us/library/system.globalization.textinfo.totitlecase.aspx[^]You can use ToTitleCase() method like followingstring titleCaseString = new System.Globalization.CultureInfo("en").TextInfo.ToTitleCase("subash neupane");
31 Jan 2012 by Sergey Alexandrovich Kryukov
First of all, you should ask yourself if you want to make it compatible with the UI library you are already using or you are willing to select you UI library based on the choice of the image recognition software. In principle, image recognitions software can be abstracted from UI, but in...
26 Mar 2012 by Espen Harlinn
Have a llok at:Use the Free USkin Toolkit to Skin your Application[^]Best regardsEspen Harlinn
13 Jun 2012 by Manfred Rudolf Bihy
It will work if you insert the periods quoted:string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0:0'.'0'.'000}",10024);The output string will be: "1.0.024"Regards,Manfred
2 Aug 2017 by ASP.NET Community
Reference about Forms Authentication in ASP.NET
7 Aug 2016 by User 9149614
Preserving alpha channel drawing transparent PNGs
4 Dec 2010 by Member 7250221
in the button's click event, assign the text box's text method to the value you want it to display for example:textbox1.Text = "item you want to display"
6 Apr 2011 by Espen Harlinn
This MSDN article provides an interesting approach:Unify Windows Forms and ASP.NET Providers for Credentials Management[^]Best RegardsEspen Harlinn
7 Apr 2011 by willempipi
I'VE FOUND THE SOLUTION!!!!The main reason that databinding a datatable to a grid is so slow is because the drawing of the columnnames takes alot time. The simple line of code:gridHeader.ColumnHeadersVisible = false;Speeds up the databinding process from 180-300 ms to 4 ms!!!Now...
29 Mar 2022 by obhasha07
Hi, I need a way to automatically scroll to a selected item in a list view. For example: There are 10 items in the list view and only the first 5 are visible. A function selects the 9th item and the list view should automatically scroll to the 9th item. I tried using the following...
10 Feb 2012 by Bertus Bever
Suppressing key and mouse events while loading
27 Mar 2012 by sjelen
Your problem is here:cmbServer.SelectedValue = iDefaultServerID;This is not the way to 'preselect' an item.Try this instead:if (cmbServer.Items.IndexOf(iDefaultServerID) > -1) cmbServer.SelectedIndex = cmbServer.FindStringExact(iDefaultServerID.ToString());else ...
26 Apr 2012 by Shahin Khorshidnia
Helloyou didn't specify WinApp, ASP.Net, WPF or others? But When you talked about office, I guess you mean Desktop application, and when you said "Form", I could guess you mean WinForm.All right:I think you could search google and find your answers by the way look at these:.Net Win...
1 May 2012 by Sergey Alexandrovich Kryukov
This is because you are doing it wrong. Actually, this is a pretty common mistake.The rendering of graphics persists only if you perform it on each WM_PAINT Windows message. For this purpose, you should handle the event System.Windows.Forms.Control.Paint, or, better yet, override the virtual...
25 Apr 2013 by Sergey Alexandrovich Kryukov
You need to use the property Dock of your control, with the value other then System.Windows.Forms.DockStyle.None (which is the...
28 Jun 2013 by OriginalGriff
Well, I'm not really surprised! Lets just take "irrelevant" code away:private void button1_Click(object sender, EventArgs e) {... String Search = "Select bookID from ss where Snumber='" + this.textBox1.Text + "'";... if (Search =="1") ...
17 Sep 2014 by Richard Deeming
Use the Windows Task Scheduler, and add a trigger to run your task when a user logs in.http://technet.microsoft.com/en-us/library/cc748841.aspx[^]
17 Sep 2014 by Sergey Alexandrovich Kryukov
Alternative to Solution 1:You can develop your own Windows Service, by whatever reason. In that service, you can handle system events using the class Microsoft.Win32.SystemEvents:http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents%28v=vs.110%29.aspx[^].The event you...
29 Sep 2015 by DotNetSteve
Variety is the spice of life - rewarding PDF AcroForm reader
7 Nov 2015 by mnguyen88
This is an alternative for "Using the jQuery unobtrusive validator with Twitter Bootstrap tooltips"
31 May 2016 by BillWoodruff
How to do this:1. build a ProcessInfo that's going to define how your "external app" window appears.2. use Process.Start with the ProcessInfo to get a handle to an instance of the external app.3. give the started Process a little time to "settle in."4. set the Parent Window ......
17 Jul 2010 by Niklas L
Verify that Form1 is in the NXT namespace, otherwise you will have to qualify it.
10 Mar 2011 by fjdiewornncalwe
For starters, don't try to mix up your logic. Separate what you want to do in your UI from what you want to do in your application logic. What I mean is that you should treat your "Yes" or "No" click logic and what happens on the form separately from the logic that you use to write information...
23 Mar 2011 by Eduard Keilholz
Have you tried the Validating event rather then the Validated event?
28 Mar 2011 by OriginalGriff
1) Comments! Add them. Use the XML comment facility, it gets your methods and fields added to Intellisense.2) Don't use "Magic Numbers" - (char)92 ? Why? 334, 376, 110? What? Use a constant instead, and give it a sensible name so I don't have to go hunting for what the heck it does!3) ...
5 May 2011 by Sergey Alexandrovich Kryukov
If you radio button are in the same group, checking one automatically un-check others. In this way, you need the handler for only one radio button. The second one could be redundant or destroy result of the first one. Remove it.Besides, what are you doing?!Who compare a Boolean with...
8 Jun 2011 by Dave Kreskowiak
It's not that simple. The standard TreeView control in the ToolBox doesn't support doing this natively, so you have to make your own, or find a third party control that does this for you.There's a couple of CP articles that cover doing something like this here[^] and here[^].
27 Jun 2011 by OriginalGriff
Easy peasy: when you create the Form2 instance, hook into the FormClosing event. You will then automatically get executed, and can refresh whatever you need to. That way, Form2 does not need to know anything about form1.private void button5_Click(object sender, EventArgs e) //Opens up...
10 Jul 2011 by Espen Harlinn
Try playing around with WPF - it has better support for nesting windows inside windows, nested inside windows - and so on ...There are also nice libraries like AvalonDock[^] that will help you manage the UI. SAKryukov do have a point - to much of this may easily confuse users ...Best...
19 Jul 2011 by lukeer
I may very well be wrong, but your code looks a lot more like C++ than C#.As for your question, WindowsForms provides a class BackgroundWorker in the System.ComponentModel namespace. It's a very convenient way of using a separate thread. MSDN[^] gives an example on how to use it.To put...
1 Sep 2011 by GParkings
If i undertsand the question correctly the following should workint lineNum = 3;textBox1.SelectionStart = textBox1.GetFirstCharIndexFromLine(lineNum);GetFirstCharIndexFromLine gets the character index of the first character on the specified line, setting the selection start to this...
1 Sep 2011 by RaviRanjanKr
In addition to GParkings solution have a look at given article which demonstrating the GetFirstCharIndexOfCurrentLine() function. Get current Caret Line and Column in a multiline Windows Forms TextBox[^]
26 Sep 2011 by Bala Selvanayagam
There is no direct way and try thishttp://www.codeproject.com/KB/dialog/FormEx.aspx]
12 Nov 2011 by uspatel
Cell StyleDataGridViewCell.Style PropertydataGridView1.Rows[0].Cells[0].Style.BackColor = Color.White;
16 Nov 2011 by Sergey Alexandrovich Kryukov
Something like that:ListBox ListBoxLog = new ListBox();//...internal void Log(string message) { ListBoxLog.Items.Add(message); ListBoxLog.SelectedIndex = ListBoxLog.Items.Count - 1;}You may also want to make it thread-safe, more exactly, to make it possible to add...
19 Nov 2011 by User008
Drag 'n Drop asynchronous files from an external server or device
24 Dec 2011 by thatraja
What about Student sitting plan generator?Already we suggested more than bunch of ideas here before. Check itProject Idea - Codeproject Search[^]
24 Dec 2011 by #realJSOP
Part of the assignment was to see if you could come up with something *on your own*.
19 Jan 2012 by Sergey Alexandrovich Kryukov
Nothing will work unless you eventually run System.Windows.Forms.Application.Run [EDIT] or, alternatively, System.Windows.Forms.Form.ShowDialog [END EDIT].This is where the main cycle of a Forms application is executed; and this is something which I would call Forms application anyway. No...
7 Jun 2012 by mmm3743
A1:I had a similar problem,try this:Use the Free USkin Toolkit to Skin your Application[^]or you can set your windows form style to none and put some pictureboxes and make theme with that(you would need to make your own resizing code)A2:Try looking at:http://www.wincustomize.com/[^],one of...
26 Apr 2012 by VJ Reddy
The references given in Solution 1 by Shahin Khorshidnia and in Solution 2 by mmm3743 are good.I think this Code Project article Winforms SkinFramework[^] by Danielku15may also be helpful.
13 Jun 2012 by VJ Reddy
To read and write data from Access database the Typed DataSet feature can be used. With typed dataset a strongly typed class is made for each Table and Row so that the columns of the Table can be accessed like properties without hard coding the Column names as strings.A Walkthrough on...
5 Jul 2012 by Sergey Alexandrovich Kryukov
The question is very unclear, but I think I can guess what's the problem. Indeed, with a virtual keyboard, when you click on a key, you need some target application to be active, so the simulated keyboard input would be dispatched to this application; at the same time, to be able to click a key...
15 Jul 2012 by OriginalGriff
As Wes says - it's pretty obvious! But please, please, don't do it that way! Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead: ...
25 Jul 2012 by Clifford Nelson
This might be of help to you: FireFox-like Tab Control[^]
15 Oct 2012 by Sergey Alexandrovich Kryukov
I think you have a confusion between form classes and instances. When you say that something is shown "twice", it may only mean that you have two instances of the same class at the same time. If you need to avoid it, you should work with only one instance. There are a number of ways to do it,...
18 Oct 2012 by fjdiewornncalwe
The % should appear within the single quote, I would also change your query to use parameters instead of the inline concatenation you use. The way you have it, sql injection is a huge risk.... SELECT file_name FROM waveform_files WHERE file_name LIKE '%" + cc_list_element + "'"
10 Mar 2013 by wingzero007
By keeping the same project, you can change the output type:1. Go to the properties of your project (right click on the project in VS).2. In the context menu, choose properties.3. In the window that appears, Select the Application tab (Should be the first one by default).4. Change the...
23 Apr 2013 by Sergey Alexandrovich Kryukov
You should use the property System.Windows.Forms.ComboBox.Text, which is the value currently presented in the edit area:http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.aspx[^],http://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.text.aspx[^].—SA
9 Jul 2013 by OriginalGriff
There are significant problems here, the first of which seems to be that you have no understanding of variables and their scope - that's not a major problem as it's pretty simple really.Let's ignore computers for a moment or two and think about friends. Suppose you have a friend called Bob,...
16 Jul 2013 by Johnny J.
If the exe is running, you can't replace it without either shutting down the process or restarting the entire machine. That is why it is common practice than an installer asks you to restart after an installation has finished.I would place the exe somewhere else, and add a job that is...
2 Aug 2013 by Ron Beyer
if (someflag == true) { if (lblsomelbl.InvokeRequired) lblsomelbl.Invoke((MethodInvoker) delegate { lblsomelbl.Text = "1234"; }); else lblsomelbl.Text = "1234"; }Basically you have to change properties that interact with the...
25 Oct 2013 by Sergey Alexandrovich Kryukov
As far as I was able to figure out, more or less recently, in this year, the Windows Installer itself is not capable of targeting Any CPU model. It's looks like it is not designed to cover this feature specific to .NET. So, in practice, you need to provide two or three MSIs for two or three...
22 Jan 2014 by Maciej Los
Have a look here:gwt equation editor[^]LaTeX Equation Editor for Windows[^]And the best: OOP in the Real World - Creating an Equation Editor[^]
26 Feb 2014 by Paddy84
Change your EditRecord form's constructor to accept a string as a parameter.private string GUID;public EditRecord(string GUID){ this.GUID = GUID;}Then when you initialise EditRecord in Form1 pass the value into the constructor.EditRecord editRecord = new...
1 Jul 2014 by George Jonsson
You could try to create a third structure with the two other structures as elements.Not exactly sure this is what you want. Some data in file 1 Something for file 2 ...
16 Sep 2014 by CPallini
What about 'The Documentation'[^] ?
17 Feb 2015 by Ramza360
Adding Focus() call should do the trick.(f = new FormDefineWord()).Show();f.WindowState = FormWindowState.Normal;f.BringToFront();f.Topmost=true;f.Focus();
30 Apr 2015 by BillWoodruff
Looks like you are using a hard-coded file-path to the images that is valid on your machine, and not valid on any other machine.What you need to do is embed the images in your Application as resources.Look at these CodeProject articles for examples of how to do that: [^].
31 Jul 2015 by majaak
Explains how numbers can be rendered like segmented numbers (looking like old-school digital clock)
10 Aug 2015 by OriginalGriff
First off, as Carlo has said, you should move time-consuming work into a background thread, to free up your UI thread. Never use Application.DoEvents - if you have to, it's a good sign that you are doing something in totally the wrong way.And I'd start it from the Form.Shown event as well...
16 Feb 2016 by Jochen Arndt
JPEG uses lossy compression while Portable Network Graphics - Wikipedia, the free encyclopedia[^] uses a lossless compression (DEFLATE algorithm). Therefore, it has no quality parameter (quality is always 100 %).However, the size of PNG images may be optimised by some methods like using a...
1 Mar 2016 by ZurdoDev
As mentioned in the comments, Write.exe.config actually IS your app.config file. It takes the name of the executable.
15 Apr 2016 by Industria Virtual
Joinning a a Text Box and a Select Combo in a HTML Form.
14 Jun 2016 by OriginalGriff
There is no standard way to do this: when you call ShowDialog it displays as an Application Modal dialog - which means that you cannot access any other forms from the current application until the dialog has been dismissed.You can't use Show and ShowDialog to have a modal form and a "spare"...
21 Aug 2016 by User 11060979
After consulting the c# reference source and comparing Button and Control- especally ctors - I found that this does the job:public class MyLabel : Label{ public MyLabel() { SetStyle(ControlStyles.StandardDoubleClick, false); }}I hope it helps.
3 Oct 2016 by lukeer
As OriginalGriff wrote, the System.Windows.Forms.Timer is a UI component. Usually you get it int your application by dragging one onto a Form.But you can instatiate it in code like you would do with every ordinary class. From any thread you like. You can then call it from that thread.But...
17 Nov 2016 by Midi_Mick
It looks to me like you're checking the wrong control. The event is attached to checkPOD, but the checkbox you're looking at is checkMoAd.
17 Nov 2016 by OriginalGriff
I'd suspect that it's working every time: it certainly does for me, and I'd be surprised if a bug like that had gone unnoticed for so many years.I suspect that it just isn't doing what you expect because it's not monitoring the same checkbox as causes the event to fire. Try changing it to use...
5 Jan 2018 by Graeme_Grant
Expose a property on Form2, then get the results in Form1: Form2 Public Class Form2 Private mResults As List(Of String) Public Property Results() As List(Of String) Get Return mResults End Get Set(ByVal value As List(Of String)) mResults...
30 Apr 2013 by OriginalGriff
This is actually pretty simple, assuming that your textboxes are all single line. (If they are multiline, it gets a little more complex as you probably need to convert them to a single string with separators, and split them back up again when you reload them)There are a load of ways to do...
8 Jan 2024 by Richard MacCutchan
Sorry, but this site does not provide code to order. You should start investigating the standard DatagridView to see how you can use it as a base for your own custom control. You might also go to the CodeProject Articles Section[^] to see if...
27 Mar 2010 by #realJSOP
Make sure you've specifically set your tab order on all controls in the form and see if it fixes it.It might be that you've written some code for the control to prevent the tab key from working.
2 Apr 2010 by Jordy "Kaiwa" Ruiter
FolderBrowserD...
10 Apr 2010 by Dalek Dave
I have this code...This is giving me the data I need, but it is presented like this in the email body...customernamecustomernumberwhereas I would like it to be customernamecustomernumberI know it is simple, but then, so am I!How do I put a new line in...
13 Jul 2010 by Dima Popov
A slightly different solution.using System.Runtime.InteropServices;private const int WM_NCLBUTTONDOWN = 0xA1;private const int HTCAPTION = 0x2;[DllImport("User32.dll")]private static extern bool ReleaseCapture();[DllImport("User32.dll")]private static extern int...
20 Sep 2010 by Florian DREVET
Brings you the ability to personalize your configuration files per developer, per machine, per configuration...
8 Oct 2010 by lukeer
Hi experts,I'm trying to give some buttons a nice look. In fact, I got the look from some designers as .png image and am now trying to get them to work on those buttons.The images do not completely fill a rectangular space. Instead, the corners are left transparent.I subclassed a...
15 Nov 2010 by ShilpaKumari
you need to enable KeyPreview (set it true) of Form by using its properties.
9 Dec 2010 by ROGDEV
Not sure I understand your question, but I think you're asking how to use timers to store the data values they are retrieving from the sensors? To begin, timers are arbitrary time keeping devices without any provisions for data storage. You need to implement that layer yourself.Next you...
2 Jan 2011 by Manfred Rudolf Bihy
This utility would interest you log4Net I presume:Apache Log4Net[^]It's the .NET spinoff of a wonderful java library. Comes with examples, enjoy.Best Regards,Manfred