C# :: How To Access User Control Form One Of The Child Form

Apr 22, 2014

I hav created mdi parent form that contain one user control. I want to access that user control from one of the child form

View 4 Replies


ADVERTISEMENT

C# :: Change Form Control Properties From User Control

May 24, 2014

I have researched quite extensively, experimented, and still cannot seem to change the properties of a control on an active winform from a user control.

So I have a user control which populates each dynamically added tab page in a tab control.

I have a textbox in the user control which I would like to type in, capture the text_change event, and change the text of the label in the winform.

View 14 Replies View Related

C Sharp :: Create Instance Of Form Into Non Form Class To Access Button / Label

Nov 23, 2014

I have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?

View 4 Replies View Related

C# :: Access To Other Form Once User And Password Validation Granted Subform

Aug 24, 2014

What I want is just to make a validation of the users and passwords already set within my array and go to the other form. By the way this form I already made it my start up form on program.cs with the same command I am trying to back to MainForm.

void Button1Click(object sender, EventArgs e) {
string error = "denied";
string[,] usrpass = {{"User1", "pass1"}, {"User2", "pass2"}, {"User3", "pass3"}, {"User4", "pass4"},
{"User5", "pass5"}};

[Code] .....

View 6 Replies View Related

C Sharp :: How To Show Print Preview In Form Control WPF

Feb 20, 2013

How to show print preview in control. I have class Printer : PrintDocument that contains what i want to print but how to show that in form and in which control.

updated: To be more precise i have listbox with documents for printing. When user selects document i want to show print preview in some control next to this

View 1 Replies View Related

C# :: Login Then Close Form And Open Main Form

Aug 25, 2014

This is more of a Application Design question, Let's say I have Form1(Login), this is opened from Program.cs, when the user enters details, the Event Handler makes a instance of a class, adds the data and stores the instance within Program.cs class.

So the best thing to do here, is to close the Form1(Login) and open Form2(Main) via Program.cs so that I can send the List<Login> object with my Login instance objects to said form. This form will remain open throughout the applications use as it's like the main GUI for all the programs functions.

When I close this form, I may want to save some information before the application is terminated, so I may as well store the Login instances in Program.cs anyway.

Main stepping stone: Multiple (usually around 3 max) users can login this system if need be, which will mean closing Form2(Main) and then opening Form1(Login) so that once Form1 is closed it can recreate the From2(Main) form and pass the new List<Login> to that form.

What's the best way to do this, at the moment i'm creating the Form2 instance like so:

//....
//Detect the Login form being closed
loginForm.Closed += new EventHandler(OnLoginClosed);
//...
//Open the main form when the login is closed
private void OnLoginClosed(object sender, EventArgs e)

[Code] .....

This seems like it will work and do the job, but is there a better and cleaner way? The List<Login> will be passed to Forms which are created via Form2(Main) as this information will be needed. It's just that ive been told not to use Forms for too much data containment.

View 2 Replies View Related

C++ :: How To Access A Method Form CPP File

May 21, 2013

How to access a method from a .h file in another .cpp file

Code:

// main.cpp

#include <iostream>
#include "inc/one.h"
using namespace std;
int main( ){

School Tadd;
Tadd.AddTeacher(1);
return 0;

[Code] ....

When I compile , i am getting the below error

In function main:
undefined reference to `School::AddTeacher(int)'
Build finished: 1 error

View 4 Replies View Related

C# :: How To Access Form Method From Another Class

Jan 7, 2015

Basically am trying to reference a method in a my Form1 class into another class. So far I have tried multiple different methods to try and access the method but have not managed it so far. Both classes use the same namespace. The part of my form class that I am using are as follows:

public class Form1 : Form
{
IContainer components = null;
private ButtonPanelThread p1, p3, p4;

[Code]....

View 4 Replies View Related

C# :: Sharing Variables From Login Form To Another Form

Mar 10, 2015

I have a form with 2 text boxes (Email and Password)

The user fills in the text boxes and clicks on the Log in button. The code behind the log in button does the following, First connects to a table (Users) in phpmyadmin. Next runs a SQL query (SELECT * FROM `users` WHERE Email = '" + sEmail + "' AND Password = '" + sPassword + "'") sEmail being the variable created from the text entered in Email text box and the same for password.

Next if the record count == to 1 it opens up the main menu form and if the record count == 0 it fails and the user does not get to the main menu.

All of the above is fine and working however what I want to do is take over a variable from the log in form to the other forms.

The code is below for the sign in button as all my code is behind that (I think this may be where I'm going wrong).

public partial class WelcomeForm : Form{
public static string connStr = "server = localhost; " +
"database = ppw5; " +
"uid = James; " +
"pwd = buster;";

[Code] .....

And the Main menu form where I'd like to take a variable over with me, lets assume the variable is the UserID from the database table that I pull from the dTable I created.

public partial class MenuForm : Form {
//Call the CloseProgram class and create a new method called ClassClose.
CloseProgram ClassClose = new CloseProgram();
WelcomeForm User = new WelcomeForm();
public MenuForm() {
InitializeComponent();

[Code] .....

View 7 Replies View Related

C++ :: Using Variables To Access Objects In Windows Form

Dec 4, 2014

Alright, so I'm making a windows form with a few hundred buttons, and one button will change color based on data the program receives over a socket. This is what I have, and it kind of works, but I don't want to have to make another if statement for all 260 buttons.

void hitmiss(std::string u){
std::string^ ind = reccdata2();
if (u == "button6"){
if (ind == "1"){
this->button6->BackColor = System::Drawing::Color::Red;
this->textBox2->Text = L"hit";

[Code] .....

What I want to do is make it more like

void hitmiss(System::String^ u){
std::string^ ind = reccdata2();
if (ind == "1"){
this->u->BackColor = System::Drawing::Color::Red;
this->textBox2->Text = L"hit";

[Code] ....

But it returns the error that u is not a part of Form1.

View 3 Replies View Related

C# :: Calling Method In One Form From Another Form?

Dec 6, 2014

I have a program which when a button is clicked on Form1 it runs a vision system operation on an image in a window on a Form1. There are also other buttons on the Form1 which can change things like threshold levels so the inspection can be run again with different settings. It all works fine but I want to change it to remove the buttons from Form1 so that when the user clicks on a button on Form1 it opens up another form, Form2, and all the buttons which were on Form1 are now on Form2 and the image analysis should run on Form1 when the buttons are used on Form2. I have taken over all the code from Form1 to Form2 and I'm trying to make this happen by creating a new oject on Form1 which calls a method on Form2 which contains the code which was in Form1 and called when the button was clicked on Form1 - not working!! I have a constructor in Form2 but I think I have become monumentally confused.

This was the code which was on Form1 when the inspection button was clicked.

private void cmdInspectOnce_Click(object sender, EventArgs e)
{
iReturn = VisionSystem.InvModeSet(IpeEngCtrlLib.I_MODE.I_EXE_MODE_ONCE);
if (_imgEngines!=null && _imgEngines[0]!=null)
_imgEngines[0].cmdInspectOnce();//InvModeSet(IpeEngCtrlLib.I_MODE.I_EXE_MODE_ONCE);
}

View 1 Replies View Related

C# :: Selection From 1 Form DatagridView On Second Form

Sep 5, 2014

I have 3 Windows Form: frmMain, frmFirstForm, and frmSecondForm.

frmMain is the form that will load when the application is started with 2 tabs to access frmFirstForm and frmSecondForm.

Here's my problem:

After making a selection from a combobox on frmFirstForm, I would like a datagridview header to change based on the selection made. Here is a list of items on one combobox: Item1, Item2, Item3, Item4. When somebody chooses Item one, the header on the datagridview on frmSecondForm should display: JohnItem1, PaulItem1, BradItem1 and so on. Those items are not part of the comboboxes, but they will be shown as header text on the datagridview on the second form either automatically or after clicking OK from frmMain. There's no OK button on frmFirstForm, but on frmMain.

The only code I have right now is the if statement on the form load on frmSecondForm. Here's what I have:

private void HeaderTextLoad() {
if(comboboxonfirstform.text = "Item1") {
datagridview1.Columns[0].HeaderText = "ItemJohn";
datagridview1.Columns[1].HeaderText = "ItemPaul";
... And so on.
}
}

View 1 Replies View Related

C :: Input From User As Char And Output In Hex Form

Sep 9, 2014

I'm trying to write a program that takes input from the user (thats a char) and outputs it to the monitor in hex form.The program is meant to continuously take input from the user then output to the monitor in hex form until an EOF is detected this triggers the program to close.The following code does this except that I get a lower case 'a' at the end of each output.I think the 'a' has to do with the enter key and if that is the case how can i tell the program to ignore this input from the user.

Example: input from user: ABC output to monitor: 41 42 43 a

Code:
#include <stdio.h>
int main(void) {
char myChar;
while(EOF != (myChar = getchar())) {
printf("%x ",myChar);
}
system("pause");
return 0;
}

View 5 Replies View Related

Visual C++ :: Allow User To Enter A Value As C String In Certain Form

Oct 14, 2013

My program was to allow the user to enter a value as a C string in the form: xxx,xxx,xxx,xxx,xxx.xx, where x can be any digit. Well, so far here is my attempt. I think the question is, would I have to implement a switch statement for the digits, the comma, and the decimal, so that when a user inputs, let say 52,000.00 the switch statements would read the 1st digit, checks for decimals/commas and if not, proceed to read 2nd digit, and repeat?

Code:
#include <iostream>
#include <string>
int main() {
using namespace std;
char buffer[256];
char tempBuff[256] = {'

[Code] ....

View 3 Replies View Related

C++ :: Create A Program That Will Let User Input Amount In Form?

Jan 4, 2014

Figure this out using [TURBO C]

Create a program that will let the user input an amount in the form (367). The Program should determine the no. of coins for each dominations : 50,25,10,5,1. (using Turbo C)

View 7 Replies View Related

C# :: Graphic User Interface - Dragging And Dropping Controls In Form

Mar 5, 2014

is there a difference when creating a graphic user interface dragging and dropping controls in the form and coding on source code, difference in a sense that the code will appear differently if the control is dragged then the code appears automatically on the source code as compared to typing it on source code?

View 2 Replies View Related

C++ :: How To Convert Compact Form Of Matrix Into Matrix Form

Oct 4, 2014

3 3
2 1 3 2 3
1 0 2
1 2 6

First line shows row and column number

First index of the second line tells the number of non-zero entries of the first row and second index tell the column number where the non zero entry is placed

for 1st row of matrix:

non-zero entries=2
column number=1
non-zero entry=3
column number=2
non-zero entry=2

covert this in the given form
0 3 3
2 0 0
0 0 6

View 1 Replies View Related

C++ :: Hangman Definition Game - Extract Word Randomly Form File And User Guess The Word

Jun 25, 2014

Basically I have a text file called words. I'm supposed to extract a word randomly form the file and have the user guess the word. If they guess the word correctly in x number of tries they will receive the definition.

I'm having trouble receiving that random word and I'm getting the definitions from the file.

Here's my code:

#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;

[Code] ....

This is what is in the words.txt file
apple#the usually round, red or yellow, edible fruit of a small tree
boat#a vessel for transport by water
horse#a solid-hoofed plant-eating domesticated mammal with a flowing mane and tail, used for riding
television#a system for transmitting visual images and sound that are reproduced on screens
soup#a liquid dish, typically made by boiling meat, fish, or vegetables, etc.
bottle#a container, typically made of glass or plastic and with a narrow neck
barber#a person who cuts hair
toast#sliced bread browned on both sides by exposure to radiant heat
radar#a system for detecting the presence, direction, distance, and speed of aircraft, ships, and other objects
red#of a color at the end of the spectrum next to orange and opposite violet

View 3 Replies View Related

C# :: Modifying User Controls While Modifying Main Form?

Jul 10, 2014

I am trying to modify a user control while modifying the main form. For example i have my main form open in one visual c# window and my user controls in another. However it seems that in order for my code changes in my user control to have any effect on the main form i need to close all my c# windows and then re-open them and even then that sometimes doesn't work am i doing anything wrong or is this supposed to happen??

Also yes i am saving and clicking build solution on my user controls.

View 14 Replies View Related

Visual C++ :: Child Window On Top Of Control

Nov 30, 2014

I have a child window above an edit control.

When the position of the control in the parent in the child on top of it is clicked the control gets topmost. Is there any way to prevent this?

View 3 Replies View Related

Visual C++ :: Passing DDX Control Variables Between Dialogs (Parent->Child)

Jul 19, 2013

I have a main dialog which has (DDX?) controls for the user. eg a slider, and a combo box.

Previously, an image adjusted by these controls was in the same dialog.

I need to put this image in a New, separate dialog but it still must be controlled by the slider and combo box on the main dialog.

My question is how can I pass the control's variables between the dialogs? I have, say,

Code:
//MainDlg.cpp
DDX_Control(pDX, IDC_ComboBrightness, m_Brightness
I was told that I could do something like:

Code:
//ImageDlg.h
public:
ImageDlg(CWnd* pParent = NULL, CComboBox m_Brightness); // standard constructor

But I get errors including: Missing default parameter for parameter 2

I also need to pass the image array, is that perhaps the same method?

View 6 Replies View Related

Visual C++ :: CEdit Control As A Child In A CListCtrl For Making Each Column Editable

Jul 8, 2013

I am using a CEdit control as a child in a CListCtrl for purpose of making each column editable. The application is a dialog based app. My problem is... I have overwritten OnOK and OnCancel in the main dialog so the edit control never receives notifications for Escape or Enter whether in OnChar or PreTranslateMessage and I would like to delete the CEdit control after updating the CListCtrl on Enter. What can I do? I have rewritten this code many many times over the past 4 days and nothing is working.

View 4 Replies View Related

C Sharp :: How To Access Functions Between Two Child Forms

Oct 14, 2014

How can I access a function in a child form from another child form of a same owner?

View 1 Replies View Related

C/C++ :: Gridview Won't Appear In Web Form

Jul 26, 2014

I have a gridview setup. It adds data into it no problem, but if I try and see it on the screen nothing appears?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Linq;
namespace FinalProject{
public partial class WebForm1 : System.Web.UI.Page

[Code] ....

View 11 Replies View Related

C++ :: How To Output One Particular Field In A Form

Aug 8, 2014

I need writing a program in c++ that will get the input of 50 different users for the following the fields (surname, other names, sex, status, date of birth) and after entering the data for these 50 users, it will then output only the list of all FEMALE users who were registered...

#include <iostream>
#include <string>
using namespace std;
int main () {
string surname, other_names1, other_names2, status, sex, dob;

[Code] ....

I don't really know what to do next - all my attempts have not really given me the result I want.

View 19 Replies View Related

C# :: Calling Event From Another Form

Mar 11, 2015

I want to update a label from Form2. When I click on the button on Form 2, the textbox on Form2 should update the label on Form1 and take me to a certain website. What ever URL is typed into the textbox on Form2 is what website URL the label on Form1 will take me to. The label on Form1 can say something such as You can check out my website here!!! and when they click on the saying it takes me to their website.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved