1,381 Topics
Windows Form Application, C#, in VS2010 Express. I get the "Object reference not set to an instance of an object." error with the line of code below, when I attempt to close the Form. [CODE]Int32 myID = Convert.ToInt32(((DataRowView)projectBindingSource.Current).Row.ItemArray[0]);[/CODE] This is a simple form with two data-bound controls. The record has …
Thank you very much for reading this. I've been programming for 15 years (VB, a lot of PHP, etc), but I've never considered myself a 'real' programmer. Mainly I'll build things that I need that are too specialized to be made by anyone else - simple programs and scripts to …
I have been all over the web (and through several books) in an attempt to get an answer to my problem. Briefly, I am trying to get the contents of a string array expressed as the header text for datagridview columns by the calling that array from a listbox. There …
I'm looking for some suggestions on how to approach this windows form based application I'm in the very beginning stages of writing. Bare in mind Im still at the Hello World level of C#. How should I populate a listbox with mock names for all jpegs in a folder whlie …
Hello I posted this in another forum but got no answer so hopefully someone here will be able to help. I'm trying to use a reportviewer in my windows form application and I can't find a way to add items to the reportviewer object. Can someone tell me how this …
Hi, I'm looking to find out how to force a refresh on a datagrid in a windows app. On a mainForm the user clicks a button to add a new record. This opens a new window. When the user has entered the data they click save and close which should …
Hello. I have a little trivial problem in my application. I have a dialog (d1) that inherits from Form. And in Main, if I call [CODE]d1.ShowDialog()[/CODE] ,it works fine. But calling [CODE]d1.Show()[/CODE] opens a bad form with pale labels and textboxes, and when I try to drag that window form …
Hello everyone! I have a form with a datagridview and another form with textboxes. First I load the form with datagridview. This one has a button which open the form with textboxes to be fill. If all textboxes are filled and I clik a button of this form, I want …
I want to pass some variables from the child form to the parent form. So at the Main form or Parent form I added the variables as a constructor: [CODE] private SampleFunction() { int a, b; //Here is where I want to use the x,y and z from the Second …
Hi !!! I have two Windows Forms. In First Windows Form i have one Text Box and one Button. In the Second Windows Form i wish to call First Windows Form and get the value of Text Box. Is this is possible? When i create a object of the First …
hello all i am developing win application into it i am using datagridview with one dynamically created datagridviewcomboboxcolumn the problem is all things working fine but while i change the value of that combo box and click on another cell the value of combocolumn gets cleared dont know whats wron …
I am trying to get a text value from NameForm and pull it in Welcome as a label value. What I have so far, when the Welcome page comes up, it does not give the value of the text but if you click on the label field, it pops up …
Hey Say I have a login and the main form. If the login window is closed then the other form shouldn't load. I tried using a if condition to suppress initializeComponent but it still shows the main form, but empty. How would you do that?
Hi, I want to clear the content of the DataTable Main, after an error as ocurred. The problem is that I want to try to load the data again [B]without[/B] closing the program. The problem is that for the 2nd time loading, it just do not show up the data …
Hi, Maybe this is a simple question... I want to open a 2nd form using a load click button. I already did it: [CODE]private void loadbtt_Click(object sender, EventArgs e) { ScndForm.Show(); ScndForm.Update(); // Rest of the instructions for load button }[/CODE] The problem is that it is only showing the …
Hi !!! I have problem with Refreshing or Redrawing my Window Form. I have one Rich Text Box on my Form and i have a list of title of books on it. I wish when I add a new title book to Rich Text Box to Refresh/Redraw the all Windows …
Hi dear all ! I am programming a windows form application using C++.net(CLR). In my program I am to draw a flow chart or such shapes with undetermined length, so I must scroll the form to enable user to see all parts of the shape. I enabled AutoScroll method of …
I have the same assignment someone else ask help with. The assignment calls for a test score calculator that calculates and displays the score total, score count, and average score. If the user clicks the Display scores button, the application sorts the scores and displays them in a message box. …
Hi !!! I have two Windows Forms. First Windows Form contain one Panel Control. This Panel Control contain other 5 child Label Controls. I wish from Second Windows Form get the number of child controls in Panel Control in First Windows Form and there Location? [CODE] // First Windows Form …
In my Forms application i tried to resize a pictureBox control during runtime and it seems to give some trouble. There is scale factor scalex , scaley which i applied to the width and height property of the control. [CODE] tempw = 980.0f; temph = 130.0f; tempw = float.Parse(pictureBox1.Width.ToString()); temph …
I have a question about a C# windows forms application.... Im aware of the mouseEnter event and the Click events, but i cant seem to combine them, maybe i could get some insight on this problem =) What i want is to be able to have a matrix of components …
I have a program that displays a website using system.windows.forms.webbrowser. It runs off files located on the computer, just html files that are not on the web. All i would need to do is link to the index page and then you can access everything. The purpose of it is …
This may be a simple question and it may be a complex question. I am not sure. Lets assume I have a windows form app that has three different areas: Area 1, Area 2. If there a way to tell the program when I am assigning tabbing order that I …
Hi ! I have one Windows Form. On it i put 4 labels and every label it have Click event. I need to understand who of labels is Clicked ? Example: [CODE]label1.Click += new EventHandler(label_Click); label2.Click += new EventHandler(label_Click); label3.Click += new EventHandler(label_Click); label4.Click += new EventHandler(label_Click); private void label_Click(object …
Good morning everybody... the following code works well in .aspx page that is in web application.. now the same thing i want to do in windows form application.. can anybody help me.. The code is for without saving the pdf file take a print.. it works well in .aspx page …
Hi everyone, I am thinking of doing something like this but I am not sure it can be done or not. Normally, if i write a program (Windows Form) I drag and drop what button and textboxes are necessary on the form then do necessary procedures and actions. What I …
Hi everyone, I'm trying to write this code. Whenever a user types a letter that matches what is already displayed, it should clean up the list box..the problem here is it is not detecting the keyDown event. What is wrong? Thanks for the help. [CODE]namespace TypingGame { public partial class …
I'm creating a compression program for one of my classes and I'm getting stumped on one aspect of it which is more cosmetic than anything but I'm going for gold here I suppose. Anyway I have a windows form that has a textbox with a button that executes FolderBrowserDiaglog (which …
hello all i am developing windows application and in a form i have 2 panel one with datagridview1 named dg1 and second with datagrideview2 named dg2 and dg1 is databound so while i click on any cell of dg1 that row will transfer to gd2 and get removed from dg1 …
how to select multiple buttons on a flowlayoutpanel?
Friends, My main form is located toward the right side of my screen so as not to cover up other open programs. I wish to locate MessageBoxes in relation to my main form (typically centered over my main form) instead of a relation to the screen. How do I do …
Hi All, Hope everyone is well, it has been a while since I last posted. I am creating a Yahtzee game, the first thing I want my game to do when it loads is ask for the player/players name/names, so that there scores can be saved to a high scores …
Hello guys. Let's say i have a unidimensional array: string[] names = {"John","Merlin","XMan","Kelvin",...,"Flash"}; How can i see how much elements i have ? I tryed with sizeof(names) but it doesn't works ... Next Question: I have a RichTextBox, and i select a text ... i change it's color, but when …
Hello Daniwebber's, I am developing a web browser. When the user clicks "Go" or "Enter" it will navigate to the website, however if it doesn't contain popular website keywords such as "http://" then I know they didn't actually want to go to a website. Then I would have it perform …
Hey guys can someone help me with this one? I have 4 forms namely Splash screen, Main, Login and Main1. In the first run the program will view the Splash screen then the Main form then the Login form and after the Main1. The problem is i cant close the …
I have a Datagridview bound to a DataTable. After doing the data binding I populate each rowheader cell in the datagridview with text. Issue is that when I perform a filter on the DataTable the text in the row header cells disappear. Anyway to make it so it that it …
Hi all, Need a little help!!! I want to create an windows application such that there are 2 forms: form1 and form2 i want the form2 to be in background of form1 and form2 should be never seen(even when form1 is minimised,maximised,resized and if some other application is opened). code …
Hi , I use richtextbox at my windows form. I set the scrollbar property is "both" and wordwrap is "true" . At some computer because of "wordwrap=true" propery , horizantal scrollbar is not visible but at others it is visible so that wordwrap is not enable. Why is richbox behave …
I NEED TO have a trance parent back ground in my windows form application,but when i try to set the background color to transe parent,it says "invalid property". so how do i set my back ground to tranceparent in VS2008
hi my freind im wanat to insert data in data grid view from text box for example when the mouse leave the text box then data transmit into dbgrid view from text box could you help me to do this, thank you ;-)
Hi all, I am new to C#,i just need your help in figuring out the issues. I have two windows forms :"background form " and "foreground form". 1)minimise the background form when foreground form is minimised. 2)move the "background form" when "foreground form is moved" Please tell me how to …
Hello everyone , Have a small problem which i dont know how to deal with . at the same time not sure if i need delegate or event handlers . here it goes . I have two classes with two forms : Form A and Progress Form . Form A …
Hi, I'm mechanical engineering graduate student in Portugal. I'm familiarized with c++ but I've been having problems with the windows forms. I'm trying to make a form that would compile diferent data with inviscid fluid flow formulas but I've got one major problem. I've done hundreds of google searches and …
I am working on a windows form application c#.How is it possible that a user name and password is already store in a database and when user load a specific website through text box it automatically sign in to that website.
Hi,I'm trying to make my own simple paint application but I'm having trouble with the "openfiledialog and paint" thing. The code below draws lines when the mouse is down and moving. The problem is whenever I press the button that opens the dialogbox everything I painted on the form disappears …
hi every one,i have one problem with DateTimePicker, i am displaying only years in dtp by setting custom Format property to yyyy and dtp format to custom and showupdown property to true. the problem is when i click once down arrow or up arrow the years in dtp continuously changing …
I am having some trouble in this one area. What I am trying to do is get a treeview that loads from the database. which I have done and it loads all the way to the final data. but what I want it to do is make a conection to …
hi there, i have a datagridview and i am validating the datagridview cell in the cell validating event, but when i type the data and prss tab the error message comes and the next cell is being selected. my code is [CODE] dgvSubContractor.Rows[e.RowIndex].Cells[e.ColumnIndex].Selected = true; [/CODE] why does it go …
I made this code: [CODE] private int a; private int b; private void Form1_Resize(object sender, EventArgs e) { adrBarTextBox.Width = b + this.Size.Width - a; } private void Form1_ResizeBegin(object sender, EventArgs e) { a = ((Form)sender).Size.Width; b = adrBarTextBox.Size.Width; } [/CODE] when i open the program and i maximize the …
Hello, I'm receiving an error message (ArgumentException was unhandled - Parameter is not valid) when I'm trying to capture a portion of the screen with a rectangle. It works great when drawing the rectangle with clickPoint.X < lastPoint.X and clickPoint.Y < lastPoint.Y, but when lastPoint.X or/and lastPoint.Y is lower than …
The End.