Sponsored Content
Full Discussion: A few C questions
Top Forums Programming A few C questions Post 302139503 by JayC89 on Sunday 7th of October 2007 07:25:56 PM
Old 10-07-2007
A few C questions

Hi guys. I'm writing a basic script in C# and there's a few areas where I am stuck, and I was wondering if you may be able to help me?

1) Can you embed an image into the source code so it will show in the windows GUI?
2) Can you change the background of the GUI?
3) How do you add an .ico to the source code so the icon looks better then the boring standard box and the top left image changes in the GUI?

If it helps here is my source code so far;

Code:
using System ;
using System.Windows.Forms ;

public class login
{
	static TextBox txt1 = new TextBox() ;
	static TextBox txt2 = new TextBox() ;
	static Button btn1 = new Button() ;
	static Label sysMsg = new Label() ;
	static Label usrMsg = new Label() ;
	static Label pwdMsg = new Label() ;
		
	public static void Main()
	{
		Form frmMain = new Form() ;
		frmMain.Text = "Login Client" ;
		frmMain.StartPosition = FormStartPosition.CenterScreen ;
		frmMain.Closed += new EventHandler(frmMain_Closed) ;
		
		txt1.Location = new System.Drawing.Point(100,10) ;
		txt2.Location = new System.Drawing.Point(100,50) ;
		
		btn1.Text = "Login" ;
		btn1.Location = new System.Drawing.Point(10,100) ;
		btn1.Click += new EventHandler(btn1_Click) ;
		
		usrMsg.Text = "Username" ;
		usrMsg.AutoSize = true ;
		usrMsg.Location = new System.Drawing.Point(10,15) ;
		
		pwdMsg.Text = "Password" ;
		pwdMsg.AutoSize = true ;
		pwdMsg.Location = new System.Drawing.Point(10,55) ;
		
		sysMsg.Text = " " ;
		sysMsg.AutoSize = true ;
		sysMsg.Location = new System.Drawing.Point(10,130) ;
		
		frmMain.Controls.Add( txt1 ) ;
		frmMain.Controls.Add( txt2 ) ;
		frmMain.Controls.Add( btn1 ) ;
		frmMain.Controls.Add( sysMsg ) ;
		frmMain.Controls.Add( usrMsg ) ;
		frmMain.Controls.Add( pwdMsg ) ;
		
		frmMain.Show() ;
		
		Application.Run() ;
		
	}
	
	private static void frmMain_Closed( object sender, System.EventArgs e)
	{
		Application.Exit() ;
	}
	
	private static void btn1_Click( object s, System.EventArgs e)
	{
		sysMsg.Text = ( txt1.Text.Equals( String.Empty ) ) ? "Incorrect Username or Password" : "Logging in..." ;
	}
}

Cheers
Jamie
JayC89
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

i got some questions :)

Hi! Im new to all this but the computer club im in has unix i think. now my questions. 1.is it NTFS i need to partion the harddrive with to be able to use unix? 2.Unix and Linux whats the diffrense?yes im a noob got no idea been using crap windows for ages and hate it. 3.I got a win98... (2 Replies)
Discussion started by: Pierre
2 Replies

2. Programming

C questions

What does "extern" do? ex. extern int x; and another question, what about using static in functions? like: static void foo(), why? (2 Replies)
Discussion started by: Esaia
2 Replies

3. Solaris

2 Questions

Hello Everbody I hope you can give me a hand, I have some questions The first one itīs about some message that I donīt know what means, I was looking about it. but nothing. This is the message rsh: connection from bad port bsd-gw: Error reading from connection: Bad file number And my... (4 Replies)
Discussion started by: lo-lp-kl
4 Replies

4. UNIX for Dummies Questions & Answers

Just a few questions.

Hi everyone im new to this forums, i just wanted to get started by asking a few question(Im a Unix newbie) 1. How do i sort a file called "dirr" in a ascending order on the 3rd column 2. what does alias on=who do Thanks in advance!!! (1 Reply)
Discussion started by: Da Paper
1 Replies

5. Programming

two questions

hey all, I have question when am writing simple shell... in the child am calling execvp, i want the parent to know when execvp returns - 1. how can i let the parent know the result of execvp thanks in advance (9 Replies)
Discussion started by: joey
9 Replies

6. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

7. UNIX for Dummies Questions & Answers

Just had a few questions

1) The lpr and sort utilities accept input either from a file named on the command line or from standard input. a)Name two other utilities that function in a similar manner. b)Name a utility that accepts its input only from standard input. 2) Explain the following error message. What... (10 Replies)
Discussion started by: youngyou
10 Replies

8. UNIX for Dummies Questions & Answers

Vi questions

Hello, I would like to know how we can highlight/select a section of a file in vi and delete that section if we don't want to use the dd command to delete one line at at time. There is one where we don't want to delete the whole line , but up to a certain word. (2 Replies)
Discussion started by: Pouchie1
2 Replies
AWSRES(1)							 AWS User's Guide							 AWSRES(1)

NAME
awsres - build resource files for Ada Web Server applications SYNOPSIS
awsres [-h] [-r unit] [-q] file... DESCRIPTION
The Ada Web Server is a library that allows you to embed a web server into your Ada application. It provides not only HTTP but also SOAP, WSDL and several other facilities. Thus you can write full-fledged web applications. awsres allows you to embed resources, such as pic- tures, into your final executable, so that your executable is completely self-contained and does not need to read other files at run time. awsres works by creating Ada source files that contain the data for your resources as arrays of bytes. You then compile these Ada source files into your executable. At run time, the AWS library automatically loads the resources from the executable whenever available. awsres creates one parent Ada package named, by default, `res', and one child package for each of the files given on the command line. The package `res' registers each resource when your application starts. To link `res' into your executable you simply add a `with res;' state- ment in one of your source files. EXAMPLE
$ ls image.png $ awsres image.png AWSRes - Resource Creator v1.0 creating image.png... -> registered $ ls res.adb res.ads res-image_png.ads image.png OPTIONS
-h Display help message. -r name Set the root unit name. Default is `res'. -q Quiet mode. SEE ALSO
wsdl2aws(1) The Ada Web Server User's Guide in package libaws1-doc. AUTHOR
awsres was written by Dmitriy Anisimkov <anisimkov@yahoo.com> and Pascal Obry <p.obry@wanadoo.fr> as part of the Ada Web Server. This manual page was written by Ludovic Brenta <ludovic.brenta@insalien.org> for Debian GNU/Linux. GNU Ada Tools 29 JAN 2004 AWSRES(1)
All times are GMT -4. The time now is 11:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy