Click here to Skip to main content
15,867,488 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Highlight text only in a listview subitem Pin
Brisingr Aerowing9-Jun-15 0:56
professionalBrisingr Aerowing9-Jun-15 0:56 
QuestionThe name does not exist in the current context Pin
Member 1148634727-Feb-15 15:53
Member 1148634727-Feb-15 15:53 
Hey, I am new to GUI programming
While trying to design a dialog box that gets user input and saves it to a file on clicking the save button, I ran into this error.
[code]
using System.Windows.Forms;
using System.Drawing;
using System.IO;
using System;
public class Mfury : Form
{
public Mfury()
{
Size = new Size(800,500);
Text = "Enter details of the book";
Label xo = new Label();
xo.Text = "Name : ";
xo.Location = new Point(10,10);
xo.Width = 50;
xo.Parent = this;
TextBox to = new TextBox();
to.Parent = this;
to.Location = new Point(90,10);
to.Width = 600;
to.Multiline = false;
string Var1 = to.Text;
Label x1 = new Label();
x1.Text = " ISBN : ";
x1.Width = 50;
x1.Location = new Point(10,50);
x1.Parent = this;
TextBox t1 = new TextBox();
t1.Parent = this;
t1.Location = new Point(91,43);
t1.Width = 600;
t1.Multiline = false;
string Var2 = t1.Text;
Label x2 = new Label();
x2.Text = "Key Words :";
x2.Width = 80;
x2.Parent = this;
x2.Location = new Point(10,90);
TextBox t2 = new TextBox();
t2.Parent = this;
t2.Location = new Point(91,83);
t2.Width = 600;
t2.Multiline = false;
string Var3 = t2.Text;
Button bo = new Button();
Button b1 = new Button();
bo.Parent = this;
b1.Parent = this;
bo.Location = new Point(520,350);
bo.Text = "Save";
bo.Height = 100;
bo.Width = 100;
Controls.Add(bo);
b1.Location = new Point(630,350);
b1.Text = "Close";
b1.Size = new Size(100,100);
Controls.Add(b1);
bo.Click += new EventHandler(onsave);
b1.Click += new EventHandler(onExit);
}
void onsave(Object Sender,EventArgs e)
{
FileStream fs = new FileStream("test.txt",FileMode.OpenOrCreate,FileAccess.Write);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(to.Text);
sw.WriteLine(t1.Text);
sw.WriteLine(t2.Text);
sw.Close();
}
void onExit(Object Sender,EventArgs e)
{
Close();
}

public static void Main()
{
Application.Run(new Mfury());
}
}
[\code]
AnswerRe: The name does not exist in the current context Pin
Richard MacCutchan27-Feb-15 22:26
mveRichard MacCutchan27-Feb-15 22:26 
AnswerRe: The name does not exist in the current context Pin
Afzaal Ahmad Zeeshan1-Apr-15 1:20
professionalAfzaal Ahmad Zeeshan1-Apr-15 1:20 
QuestionJoystick Windows Forms User Control Pin
Abinonos15-Feb-15 9:37
Abinonos15-Feb-15 9:37 
AnswerRe: Joystick Windows Forms User Control Pin
Gerry Schmitz1-Apr-15 0:39
mveGerry Schmitz1-Apr-15 0:39 
QuestionGridView checkbox cell Pin
Wild Thing11-Feb-15 23:00
Wild Thing11-Feb-15 23:00 
QuestionRe: GridView checkbox cell Pin
Richard MacCutchan12-Feb-15 1:05
mveRichard MacCutchan12-Feb-15 1:05 
AnswerRe: GridView checkbox cell Pin
Wild Thing12-Feb-15 2:57
Wild Thing12-Feb-15 2:57 
GeneralRe: GridView checkbox cell Pin
Wild Thing12-Feb-15 22:31
Wild Thing12-Feb-15 22:31 
QuestionAny tips on how to create a UI like blizzard/origin/steam game clients using WinForms? Pin
vizimuchi11-Feb-15 8:29
vizimuchi11-Feb-15 8:29 
AnswerRe: Any tips on how to create a UI like blizzard/origin/steam game clients using WinForms? Pin
Richard MacCutchan11-Feb-15 21:49
mveRichard MacCutchan11-Feb-15 21:49 
AnswerRe: Any tips on how to create a UI like blizzard/origin/steam game clients using WinForms? Pin
den2k8812-Feb-15 2:01
professionalden2k8812-Feb-15 2:01 
Questionunsure of controls to use Pin
minnie mouse5-Jan-15 11:14
minnie mouse5-Jan-15 11:14 
AnswerRe: unsure of controls to use Pin
Richard MacCutchan5-Jan-15 22:54
mveRichard MacCutchan5-Jan-15 22:54 
QuestionInternship Management System Pin
Member 112919486-Dec-14 22:37
Member 112919486-Dec-14 22:37 
Questiondatagridviewtextboxcell error on 350 characters Pin
Rhyde Marsh12-Nov-14 11:06
Rhyde Marsh12-Nov-14 11:06 
QuestionRe: datagridviewtextboxcell error on 350 characters Pin
Richard MacCutchan12-Nov-14 21:26
mveRichard MacCutchan12-Nov-14 21:26 
AnswerRe: datagridviewtextboxcell error on 350 characters Pin
Rhyde Marsh13-Nov-14 3:39
Rhyde Marsh13-Nov-14 3:39 
GeneralRe: datagridviewtextboxcell error on 350 characters Pin
Richard MacCutchan13-Nov-14 4:26
mveRichard MacCutchan13-Nov-14 4:26 
GeneralRe: datagridviewtextboxcell error on 350 characters Pin
Rhyde Marsh13-Nov-14 5:25
Rhyde Marsh13-Nov-14 5:25 
GeneralRe: datagridviewtextboxcell error on 350 characters Pin
Richard MacCutchan13-Nov-14 5:38
mveRichard MacCutchan13-Nov-14 5:38 
GeneralRe: datagridviewtextboxcell error on 350 characters Pin
Rhyde Marsh14-Nov-14 1:27
Rhyde Marsh14-Nov-14 1:27 
QuestionRe: datagridviewtextboxcell error on 350 characters Pin
Eddy Vluggen13-Nov-14 5:38
professionalEddy Vluggen13-Nov-14 5:38 
AnswerRe: datagridviewtextboxcell error on 350 characters Pin
Rhyde Marsh18-Nov-14 5:36
Rhyde Marsh18-Nov-14 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.