Click here to Skip to main content
15,889,116 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 Title

Forms 

19 Jul 2015 by wafa_7903
Please help me to solve this code if there is error..I have this error message-Conversion failed when converting the varchar value '@IDPRO ' to data type int. .I work with SQL 2014 and VS 2012CLASSES class DataAccessLayer { SqlConnection SQLcn; //This...
19 Jul 2015 by Wendelius
Based on the code the value in @IDPRO variable goes to column ID_PRODUCT in the table. You have defined that parameter as a varcharparam[0] = new SqlParameter("@IDPRO", SqlDbType.VarChar, 50); param[0].Value = ID_PRODUCT;but most likely the column definition in the database is int.
22 Jan 2014 by Roland gr
HiI am currently working on a desktop application which allows students to take examinations electronically. I would like to know if it is possible to get a plugin for Visual Studio which would allow me to implement something similar to Equation Editor in Microsoft Word into a Windows Forms...
22 Jan 2014 by CPallini
I think your best bets are the Equation Editor itself and MathType. Unfortunately none of them is free, as far as I know.
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[^]
24 Nov 2011 by ortund
Login system with breach redundancy handling.
25 Mar 2013 by theitmueller
Bit difficult to describe.A form with a panel (DOCK BOTTOM) and a TableLayoutPanel (DOCK FILL).TableLayoutPanel has 2 rows, 1 column each with a user-written control.Sizing the form in the development environment works fine.If I start the application, create an instance of the form...
25 Mar 2013 by OriginalGriff
I tried to do exactly the same, and I can't duplicate your problem.A form, with a panel, Dock bottom, and a TableLayoutPanal Dock fill and various ways to maximise teh form on startup - the panels appear as I expect. The TLP fills the screen, with a smaller panel overlaying in at the...
2 Aug 2011 by obhasha07
Hi, I'm creating a function where it edits an HTML file, loads it into a web browser control and then print the HTML document. The web browser loads the HTML file but doesn't print it. It's all in one function. I even tried using ShowPrintDialog method. But it does nothing!!! Not even an error...
14 Mar 2014 by Nikita D. Sinelnikov
HowTo: make the report background (elements) of Microsoft .NET Report (.rdlc) non-printable
18 Feb 2017 by Member 13009199
Hi,I want to have 2 forms on 1 page, I had duplicated the 1st form and gave it an other ID but for some reason the 2nd forms validation / success messages do not appear in the form page but a blank page. The form is send successfully however.
16 Aug 2015 by ilostmyid2
In C++, when creating a Windows application which includes a form, there's a hotkey to test it before running the application (Ctrl+T).Is there such a thing for C# forms?
17 Aug 2015 by Thomas Nielsen - getCore
You can run your unit test using a different shortcuts in your unit test file, see this link for details https://msdn.microsoft.com/en-us/library/ms182470.aspx[^]So if you exercise your form in unit tests you canYour design surface will only execute the constructor, so if you wanna flip to...
17 Aug 2015 by Andy Lanng
Hi,The following article will help you set up a unit test project within Visual Studio.Creating Unit tests for your c# code[^]Once you have your tests created then you can run them with Ctrl+R,AThese unit tests are also used in TDD when the tests are written first then the methods...
26 May 2019 by Ido Doron
Let's say I have one html web-page (form.html) containing a simple form which is sent using POST method: ...
12 Jan 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Refer - Read Post Data submitted to ASP.Net Form[^]Quote:Read the Request.Form NameValueCollection and process your logic accordingly:NameValueCollection nvc = Request.Form;string userName, password;if (!string.IsNullOrEmpty(nvc["txtUserName"])){ userName =...
26 May 2019 by Musab ibnu Siraj
string firstname = HttpContext.Current.Request["firstname"]; or string firstname = Request.Form["firstname"];
2 Aug 2013 by See_Sharp
Hi,I am trying to change a control's property inside an event (Control from a Form). Here's what I am trying to do:- In a Timer's Event Handler, try to change a Label's text:private void someTimerEvent(object source, ElapsedEventArgs e){ if (someflag == true) { ...
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...
5 Jun 2014 by Sergey Alexandrovich Kryukov
Disclaimer!This Question is asked just for fun.Few CodeProject members expressed their interest in my idea of the competition"Most Elegant and Comprehensive Solution of a Completely Useless Task".I've chosen the title "Completely Useless Challenge". I promised to come up with the...
17 May 2011 by Nintynuts
Hi, I'm trying to keep a form active but hidden rather than closing it. I think maybe I need to intercept the close message and change it, then call Hide() instead. The main (parent) form should dispose the child forms on exit. I think I understand the principles, but I don't know how to put it...
17 May 2011 by Sergey Alexandrovich Kryukov
Here is how to do it: override System::Windows::Forms::Form.OnFormClosing method:virtual void OnFormClosing(System::Object ^sender, System::Windows::Forms::FormClosingEventArgs ^e) { if (e->CloseReason == System::Windows::Forms::CloseReason::UserClosing) { Hide(); ...
13 May 2021 by obhasha07
When I try to run my VB.net 2010 project I get the error."System.InvalidOperationException occured in PCDoctor.exeAdditional Inormation: An error occured creating the form. See Exception.InnerException for details. The error is: Conversion from string "" to type Double is not valid.I...
13 Sep 2011 by Rakesh Meel
This problem occurs because multiple threads in the application call the Hashtable.Insert method at the same time.
28 Jul 2011 by Michael Waguih
Hi all,In my project I have a MDI_Parent form where I can show several MDI_Child.When opening any Child_Form it is running well but when closing the one at the front, only the MDI_Parent appears and the Child_Form titles appear with the boxes minimize , maximize and Exit.On maximize...
26 Mar 2011 by Abhinav S
You can start by making sure any third party your child form uses are installed.Try to open the form in design mode and post the error that occurs here and maybe someone can help you.
27 Mar 2011 by Dalek Dave
I am sure there will be more help available if you were to post some of the code.Hard to know what is going on without it, but are you calling the forms correctly? Are there any DLLs attached to the form? Where is the Focus?More information = More Help.
27 Mar 2011 by Brijesh Kr
I think you are using like follow:At an event of a control of MDI use follow: child ch=new child(); ch.MdiParent = this; ch.Show();First you should have a Form, enable it's IsMdiContainer=true.child is a normal form.
28 Jul 2011 by Michael Waguih
I found the solution by assigning the Start position property of the child form to "center parent"
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
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
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
7 Jun 2016 by The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
30 Oct 2019 by Member 13923913
Hi, my app is sending notifications to the user, which should open a certain page in the app when tapped. Passing parameters works fine, opening the page, too. But one problem drives me mad: every time when the app is called from the notification-intent, a new activity-instance is created and...
15 Jun 2016 by Manoj Chamikara
I create a small application I select files form folder then Press My Hotkey it sends a Copy Command Like thisSendKeys.SendWait("^C");but after i cant get file paths from Clipboard but notepad text working fileWhy is that any other way to get file paths to clipboardWhat I...
14 Jun 2016 by Simon_Whale
Your best off using the clipboard class. Have a read of this Clipboard handling with .NET[^]
15 Jun 2016 by Alan N
It is possible that SendKeys is not activating the shortcut command Ctrl-C. You may get the desired result by sending a sequence of menu commands.In Explorer the menu equivalent of Ctrl-C isAlt-E Open the edit menuC 'Click' the copy menu itemInstead of Ctrl-C send Alt-E...
9 Aug 2015 by Keith Barrett
Describes a 'Proof of Concept' project for a Code-First User interface library.
19 Jun 2012 by A. Ganzer
Validation of input made as easy as possible for Windows.Forms, WPF, console-applications or any other purposes
15 Jan 2024 by Member 4206974
FormGen, a JavaScript Form Generator
1 May 2011 by Member 7883205
I am having an unexpected problem with visual inheritance in Visual Studio C#. There is a base form, from which several derived forms inherit. Everything compiles nicely, without errors, but the derived forms look exactly like the base form, even though they shouldn't (the derived forms have...
29 Apr 2011 by OriginalGriff
Odd.I just tried it (deriving directly from a form is not something I do that often, so I wanted to be sure)I have an existing form called frmPurchaseTypeI added a form called frmDeleteMeI changed the frmDeleteMe.cs file to: public partial class frmDeleteMe : frmPurchaseTypeI...
11 Oct 2011 by Sergey Alexandrovich Kryukov
Form inheritance works without any problem. What you see is just a bug, nothing else. Without a look at you project it's hard to say what's wrong.A note: there is no such thing as "parent form" in relation to other form. [EDIT] Well, quite formally, it does exist as Form is Control; but if...
1 Mar 2016 by Southmountain
I have an example from the article.here is the App.config file: here is the console program...
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.
1 Jan 2021 by Ralf Meier
I have created a Component which provides some Properties to other Controls. For this the Component implements the IExtendedProvider and uses ProvideProperty to do this. When I look inside the PropertyGrid of one of these Controls it doesn't look...
29 Dec 2020 by Richard MacCutchan
I had a similar issue some time ago, creating a scrolling marquee to display a message. I used the following to add properties to my control (C# but the idea is the same): public class Marquee : System.Windows.Forms.Control { #region...
2 Jan 2021 by Ralf Meier
The mistake was the wrong keyword and the wromg place for searching. Finally I found the answer by myself in this Forum instead of at Google by using the keyword "IExtendedProvider" instead of "ProvideProperty". Now I am leaded to this article...
23 Jan 2013 by Tarek Elqusi
I created a simple form with a button to add a label control at run time sequentially numbered; labels are movable and lines are drawn between labels.
30 May 2012 by Murray Brooks Davis
How to make a simple, end-to-end, mobile, Java enterprise application including a RESTful web service and an Android client.
14 Feb 2017 by #realJSOP
I think what you want might be to call this.Hide() when it loses focus. There's no need to set the TopMost property.
14 Jul 2011 by manchukuo
Hello guys!I have a program that uses some threads at the same time that retrieve a page, wait for response, parse the response and then save the data in a DB using Sqlite.Now when i want to close my program and there are these threads running it takes some time so it closes. how can i...
14 Jul 2011 by #realJSOP
Use the asynchronous reader execute methods (BeginExecuteReader/EndExecuteReader instead of ExecuteReader, for instance).
16 Jul 2011 by Philippe Mori
I would say hide the form until the operation is completed and then close it. This would be adequate if the wait is at most a few seconds and then intend is to make it appears responsive...BackgroundWorker can also be used and cancelled... Assuming that you can check for cancellation often...
12 Apr 2012 by SinaNadi
HelloI have some file that I download them from a website in c# windows form with ftp.when I want to download them I get this error:Access to the path '...' is denied.What can I do?
12 Apr 2012 by lean90
I think is Security Windows. You can Setting in Control PannelsOrThat File Contains Virut Your FireWall Access denied you
12 Apr 2012 by Eduard Keilholz
Make sure you have access to the path (e.g. enough permissions on the ftp server) or add a directory name to connect to, which should be a directory you do have access to.
5 Mar 2012 by arpoarpo
Suppose we have an Access 2010 form that allows a user to navigate over every single employee in the table Employees.Suppose also the form contains a TextBox txtId where the user can type the Id that uniquely identifies an employee. After clicking a button OK the form should show the...
5 Mar 2012 by Clifford Nelson
An Access form has a Filter and an FilterON property. Just need to set the FilterOn to True and the Filter property to the text as would appear in a SQL Where clause (ie, Company LIKE "C*").Me.Filter = "Company LIKE """ + CompanyFilter.Text + """"Me.FilterOn = TrueThis should also work...
7 Apr 2012 by SinaNadi
HelloI have a website And have a windows application, how can I access the files on my website and show them in windows forms(C#)
7 Apr 2012 by Not Active
What files? Do you mean some common files, such as Word documents? Or the html or aspx files of the website?For the former you could create a webservice to expose the files to both applications. For the latter, why?
7 Apr 2012 by Sergey Alexandrovich Kryukov
If you don't want to create a Web service and really want to work with some existing Web site, you can do it using the techniques of Web scraping. Please see:http://en.wikipedia.org/wiki/Web_scraping[^].Basically, you will need to use the class System.Net.HttpWebRequest, please...
2 Jun 2016 by Member 12561869
I know I can use the following in a RichTextBox to change properties of my font. Bold Italics Underline Center Left Right Carriage Return Change Font Size to a numbered size Change Font Color ie: RedBut how do...
9 Sep 2015 by Norbert F.D.
Hello.I want to create a user/password form and authenticate a user from Active Directory using ASP.NET MVC X.Lot of thanks.
9 Sep 2015 by Passion4Code
HelloAD Authentication[^]Please follow the article. Very nicely and precisely written.Hope it helps.Thanks
14 Sep 2015 by Norbert F.D.
Lot of thanks. But, I don't know why, but it doesn't works.Can you help me please?This is my code:Web.config
9 Apr 2012 by bhagirathimfs
I want to implement accordion in the winFormsPlease helpThanks.
7 Apr 2012 by Shahin Khorshidnia
Sorry! I didn't understand your intention at first :DI think you can find it. Look at this: Accordion control in Win Forms
9 Apr 2012 by VJ Reddy
I think you want MS Outlook style navigation controls which is similar to accordian controls of ASP.NET.A free control, VIBlend Accordion Navigation Pane for Windows Forms (vNavPane), is offered free by VIBlend, information about which is found...
23 Oct 2014 by kenitoskato
http://www.codeproject.com/Articles/416521/Easy-WinForms-Accordion-Control
12 Apr 2012 by geice
I have looked in many places, but found no need WHATThe thing is, I have a TabControl TabControl and within thisobviously have TabPages TabPages and within these forms have, there isgetting my problem (noob), when I open a tab at a timeworks fine, but when I leave an open and open the...
18 Apr 2012 by Maciej Los
I wrote for you a simple class to add and removes tabs (with forms). The solution is not perfect... You need to remember: this is an example!Steps to achieve a solution:1) We need an interface[^]Public Interface IFormsInTabs Function AddTab(ByVal frm As Windows.Forms.Form) As...
19 Mar 2015 by Ratnesh Mani Tripathi
Thanks Sir It Works.I give 5 star Out Of Five Star.
2 Apr 2012 by bhagirathimfs
How i will add controls dynamically at the top of the panel??My problem:I have 5 notifications . After each 10 second a timer will run and take data from database. If new notification found than that will insert to the panel at the top.Means new notifications will present at the top and...
2 Apr 2012 by Sergey Alexandrovich Kryukov
I have a very general cookbook recipe for many problems of such kind.You have a doubt how to create some part of UI in code? But can you make just a sample of the UI design you want using the designer? If so, do it in designer in some research project. Do bare layout; everything else you can...
8 Mar 2011 by programmer1234
I'm making a Windows form which allows people to select a film from different genres. I've used list boxes to display the list of films and genres. When a user selects a genre, the films from that genre are displayed in another list box. The user selects a film from that list box, then a picture...
8 Mar 2011 by Michael Bookatz
You need to handle the event of the click button.Once that is handled you can get the current selected item in the listbox by listbox.SelectedItem .All you then need to do is pass in the relevant values to a Stored Procedure in the database via ADO.net
8 Mar 2011 by William Winner
Do you mean that you're using a MessageBox with YesNo buttons?If so, you need to capture the result of the MessageBox and check it against DialogResult.Yes as in:DialogResult result;result = MessageBox.Show("Do you want to save this?","Save Inception",MessageBoxButtons.YesNo);if...
10 Mar 2011 by programmer1234
I'm making a Windows form which allows people to select a film from different genres. I've used list boxes to display the list of films and genres. When a user selects a genre, the films from that genre are displayed in another list box. The user selects a film from that list box, then a...
10 Mar 2011 by OriginalGriff
If you can read the info from the listbox - which your question implies, then it is pretty easy, assuming you have set up the database already. I assume you are using SQL Server?using (SqlConnection con = new SqlConnection(strConnect)) { using (SqlCommand com = new SqlCommand("INSERT...
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...
2 Dec 2014 by lukeer
Hi folks,user shall be able to edit a list of these cute little demo objects:class Foo{ public int FirstCol { get; set; } public int SecondCol { get; set; } public Foo(int first, int second) { FirstCol = first; SecondCol = second; ...
13 Dec 2014 by Anisuzzaman Sumon
As a result of googling a lot I've come to a decision that actually there is no way to add new row to a datagridview which has a binding source.However I am not sure at all.But According to your need I am giving you a solution I think it works for you fine.Please check it.Thanks ...
14 Dec 2014 by lukeer
The solution is to add a parameterless Foo constructor.class Foo{ public int FirstCol { get; set; } public int SecondCol { get; set; } // This c'tor is needed for the user // to add entries from within // a databound DataGridView. public Foo() { } ...
21 Jul 2011 by Rico_
Hi , i have built an app to split images to the local drive of a p.c, the problem i am facing is that i need to fill a listView control on the app with the images that i have split. i have tried via an imagelist and by adding the images to the listView but it takes too long to load images. Is...
21 Jul 2011 by Mario Majčica
Virtual mode is your solution.Check this article Virtual Mode ListView[^]Cheers
22 Mar 2011 by Theingi Win
If you want to add new data,you should clear first data in your grid View.you try the following code sample TestData td1 = new TestData("New Data"); data.Add(td1); dataGridView1.DataSource = new List(); dataGridView1.DataSource =...
22 Mar 2011 by Groulien
A question has been bugging me for a while, and after some searching I'm just going to ask it.I have a custom class and got it up and running in a gridView (in a Windows Form, not WPF) as follows://classpublic class TestData{ public string Name { get; set; } //bad practice, I...
22 Mar 2011 by Albin Abel
You may need to have a Static list. Here is an example.public class TestData{ public string Name { get; set; } //bad practice, I know. public TestData(string name) { this.Name = name; }}public class TestDataList{ public static...
23 Mar 2011 by BobJanova
Is there a reason you can't use a BindingList? BindingList implements the IBindingList interface which causes observers to be notified of list modification events (add, remove, move and update).If you can't use or override BindingList then you have to implement the interface...
15 Dec 2010 by hector [.j.] rivas
Helping the combo box autocomplete function with a frequency count.
29 Apr 2012 by Fred Andres
I'm using Visual Basic in Visual Studio 2010. How do I add a textbox to a form from within the code?
29 Apr 2012 by Maciej Los
Dim TextBox1 As TextBox = New TextBoxWith TextBox1 .Top = 8 .Left = 16 'set the other propertiesEnd WithMore at MSDN[^] site.
29 Apr 2012 by Fred Andres
Public Class Form1 Dim lowerBound As Double Dim textBoxes(4) As TextBox Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load TextBox1.AppendText("sales") textBoxes(1) = New TextBox() With textBoxes(1) ...
29 Apr 2012 by Sergey Alexandrovich Kryukov
How could you see your control if you don't do anything to see it? The "answers" I've seen so far also lack the main piece of code you need.To see your newly created control, you also need to call parentControl.Controls.Add(newlyCreatedControl); where parentControl is some control to become...
27 Apr 2012 by PointBreaker
In my C# windows form program, i have two forms: 1 is Form and the other one is Form2the Form is where I put data on the textboxes and the Form2 is where is a datagrid wich shows a table with the data i inserted. Now, how do I put data from a table to a form?My code on Form2namespace...
27 Apr 2012 by VJ Reddy
I think something like this can be done.In Form a DataTable say DataTable1 is created and it is populated with the values from the TextBoxes.In Form2 make the visibility (accessibility) of DataGridView as public.Then in the Click event of Button1 of FormForm2 form2 = new...
7 Jun 2013 by joshrduncan2012
Hi everyone!I have a simple issue that I can't see a resolution for right now. I'm hoping someone can pinpoint what I'm doing wrong.Main goal: Create new datarows for a datatable and add values for 3 columns to each datarow.DataTable waveform_file_dt = new DataTable();DataRow...
7 Jun 2013 by Richard C Bishop
Have a look here:Clicke me[^]This might be what you are looking for.