|
Thanks for replying.
I did just that and the options I get when I select Add New Item doesn't
give me the option "Other Project Types". I right clicked on the solution.
Is there anything I am doing wrong
|
|
|
|
|
You have to right-click the very top line of the Solution Explorer. Add, Add New Item, then you'll see either a Other Project Types or Setup and Deployment or both.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks it works perfectly
|
|
|
|
|
I'm getting some problem to bind my DropDown control with an xml file...
I made an example using xmlTextReader displaying it in a table format. its working...
But i need to display data in my dropdown control using xmlTextReader....
please help....
here is my example coding...
private void Page_Load(object sender, System.EventArgs e)
{
// Placer ici le code utilisateur pour initialiser la page
string strAtt,strType,strName,strValue,strTemp,strPath;
strPath=Server.MapPath("list.xml");
System.Xml.XmlTextReader xmlRdr;
xmlRdr=new
System.Xml.XmlTextReader(strPath);
strTemp="<table border=1 width=100%><tr><th width=150px>ISBN No.</th><th>Book Name</th></tr>";
Response.Write(strTemp);
while(xmlRdr.Read())
{strType=Convert.ToString(xmlRdr.NodeType);
strName=xmlRdr.Name;
if(strType=="Element")
{
if(strName=="subject")
{
strAtt=xmlRdr.GetAttribute("name");
strTemp="<tr><td colspan=2 align='left' bgcolor='pink'>"+strAtt+"</td></tr>";
Response.Write(strTemp);}
else if(strName=="book")
{
strAtt=xmlRdr.GetAttribute("isbn");
xmlRdr.Read();
strValue=xmlRdr.Value;
strTemp="<tr><td>"+strAtt+"</td><td>"+strValue+"</td></tr>";
Response.Write(strTemp);
}
}
}
Response.Write("</table>");
xmlRdr.Close();
}
and now how will i change this code to display in a dropdown control????
-- modified at 3:07 Friday 20th January, 2006
|
|
|
|
|
Hi all,
How can i add a user control as a treenode to a TreeView control using C#.
What are all the steps that i need to take in order to accomplish the above task?
Any examples or links will be helpful.
Thanks in Advance
Phani Kiran K.
|
|
|
|
|
Hi, I have created the following program first as a console application. I have used the printData() method to output the data of an instance of a Person or Athlete class. I want to create a label and show the data in a label. When I try to create a label, or any similar control, that control isn't seen in the TestClasses class, and the Athlete. It is seen only in the Person constructors. Any help would be appreciated.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace windowsPracticingWithClasses
{
///
/// Summary description for Form1.
///
public class Person : System.Windows.Forms.Form
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
//My instance variables
private string firstName, lastName;
private int age;
private double height, weight;
private string bankName;
private double bankAccount;
private double balance = 0;
private string squareColor;
# region Properties
//Properties
public string FirstName
{
get { return firstName; }
set { firstName = value; }
}
public string LastName
{
get { return lastName; }
set { lastName = value; }
}
public int Age
{
get { return age; }
set { age = value; }
}
public double Height1
{
get { return height; }
set { height = value; }
}
public double Weight
{
get { return weight; }
set { weight = value; }
}
public string BankName
{
get { return bankName; }
set { bankName = value; }
}
public double BankAccount
{
get { return bankAccount; }
set { bankAccount = value; }
}
public double Balance
{
get { return balance ; }
set { balance = value; }
}
public string SquareColor
{
get { return squareColor ; }
set { squareColor = value; }
}
# endregion
//Custom constructor
public Person(int age, double height, double weight, string bankName, double bankAccount, double balance)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.age = age;
this.height = height;
this.weight = weight;
this.bankName = bankName;
this.bankAccount = bankAccount;
this.balance = balance;
}
//Default constructor
public Person()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
#region My Methods
//My Methods
public void makeDeposit(int amount)
{
balance+= amount;
}
public void makeWithdrawal(int amount)
{
balance-= amount;
}
public virtual void printData()
{
Console.WriteLine("\nProfile: \n\nAge: " + this.age);
Console.WriteLine("Height: " + this.height);
Console.WriteLine("Weight: " + this.weight);
Console.WriteLine("Bank Name: " + this.bankName);
Console.WriteLine("Bank Account: " + this.bankAccount);
Console.WriteLine("Balance: " + this.balance);
}
#endregion
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
//
// Person
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Person";
this.Text = "Form1";
}
#endregion
}
class Athlete : Person
{
public string sport;
public Athlete(string sport) : base(23,5.6,120,"Chase",5671234,1000)
{
this.sport = sport;
}
public override void printData()
{
base.printData();
Console.WriteLine("Sport Practicing: " + this.sport);
}
};
class TestClasses
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Person());
Person[] person = new Person[5];
person[0] = new Person(22,5.6,120,"Chase",5671234,2000);
person[0].printData();
Person[] athlete = new Athlete[3];
athlete[0] = new Athlete("Figure Skating");
athlete[0].FirstName = "Sarah";
athlete[0].LastName = "Hughes";
athlete[0].Age = 20;
athlete[0].Height1 = 5.5;
athlete[0].Weight = 120;
athlete[0].BankName = "Chase";
athlete[0].BankAccount = 434324;
athlete[0].Balance = 200;
athlete[1] = new Athlete("Martial Arts");
athlete[1].FirstName = "Kim";
athlete[1].LastName = "Chung";
athlete[1].Age = 21;
athlete[1].Height1 = 5.7;
athlete[1].Weight = 130;
athlete[1].BankName = "Citi";
athlete[1].BankAccount = 212312;
athlete[1].Balance = 300;
athlete[2] = new Athlete("Soccer");
athlete[2].FirstName = "Joe";
athlete[2].LastName = "Tribiani";
athlete[2].Age = 22;
athlete[2].Height1 = 5.6;
athlete[2].Weight = 140;
athlete[2].BankName = "Apple";
athlete[2].BankAccount = 123124;
athlete[2].Balance = 400;
for(int i = 0; i < athlete.Length ; i++)
{
athlete[i].printData();
}
Console.ReadLine();
}
}
}
|
|
|
|
|
Hi!
I'm not completely sure if I've understood your problem, but it seems to be an attribute visibility question.
You should learn about the differences between private, protected, internal, public (from MSDN, for example[^]), then the solution will dawn on you...
Regards,
mav
|
|
|
|
|
Hi, thanks for the response. Basically I have a base class Person and a child Class Athlete. In the main function I have created an instance like the Person[] athlete = new Athlete[3]; and populated it. Then I call the printData function. In console application there was no problem to see the output as follows:
for(int i = 0; i < athlete.Length ; i++)
{
athlete[i].printData();
}
How can I do the same but now to see the output in a label?
Thanks alot.
|
|
|
|
|
How can I keep a form deactivated and still accept text input? By setting the WS_EX_NOACTIVATE flag, I can put a form in background and receive mouse hit. But textbox can't accept any key.
Best Rgds.
Martin
|
|
|
|
|
No it can't. Deactivating the form prevents the input focus from being moved to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thanks for the reply.
Probably I've used the wrong term. What I want to achieve is a form that is always below other normal window, even when it has the keyboard focus. I know this can be done because I've seen that in other apps. One popular example is setting Konfabulator widget window to "below".
Rgds.
marin
|
|
|
|
|
I've never used it, but I think I know what you're talking about. Hmmmm... This is going to be quite difficult because you talking about a normal app anymore. It could be that I'm just really tired, but I have no idea how you're going to get this to work, or what API's you're going to have to call to do this. I THINK this would be a Shell Extension, but I can't positively confirm it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm building something not entirely unlike the auto-resize C# Listbox [http://www.codeproject.com/cs/combobox/listbox.asp], and am trying to decide where to start. That project based their control on the Panel in order to get things like scrolling for free. The undesirable side-effect is that the derived control is a container, and is treated like such in the designer. For example, you can drop controls into their listbox and the designer will assume that the listbox (being derived from a panel) should act as a container.
So what's the workaround? Is it easier to (a) implement a scrollable view from scratch, or (b) modify a container control to no longer be treated as a container in the designer.
Any pointers on doing either would be appreciated. I have read, by the way, a bit about implementing a derived designer class, but the existing literature doesn't go into enough detail to explain anything about a control being a container or not.
|
|
|
|
|
Hi,
I am having Listview control which contains 15 rows. My problem is i want to make row 8 as read only. Is it possible in listview control.
thanks in advance
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
You can use BeforeLabelEdit event
private void ListView1_BeforeLabelEdit(object sender,
System.Windows.Forms.LabelEditEventArgs e)
{
if (e.Item == 7)
{
e.CancelEdit = true;
}
}
|
|
|
|
|
Hello all!
I am using a C# program and would like to create database (SQL Server 2000) from the source code. Can anyone provide some help.
Thanks All,
Tran Dung
|
|
|
|
|
The thing to type into google is ADO.NET, you'll find a ton of examples. If you mean you want to create a database from scratch, just write a script to create a database, and execute it in C#, using ADO.NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
tadung wrote: I am using a C# program and would like to create database (SQL Server 2000) from the source code.
You can execute any SQL Script through SqlCommand not just the regular SELECT, INSERT, UPDATE & DELETE.
Here is an example of Running SQL scripts with a .NET application[^]
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Hi all,
My program is just a small .EXE file since i'm not using any special dll's.
1. does the user must install FRAMEWORK on his computer even though i use
just a few dll's?
2. if i use FRAMEWORK 1.xx is it ok for him to install version 2.xx ?
3. is it posible to make an installation package that will contain the
FRAMEWORK package because i dont want to send the users to microsoft
website , its not nice.
Thanks alot,
Ran.
R.Z
|
|
|
|
|
1. Yes, they need the framework.
2. It depends. You should test on 2.0 and make sure that your app is written to not be strongly associated with an older version. You can make an app require a version, or it can find the closest version. Also, if you're distributing a framework anyhow, why not make it the one you're using ?
3. Yes, I think you can download merge modules for installers. I personally write an installer app in C++ that runs the framework install and runs my MSI as well. It's possible to install the framework silently, though.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
is it posible to install few versions on the same computer?
i mean , if i will give the user the old version and he allready have a newer version will it install and use the old version along the already-installed newer version?
Ran.
R.Z
|
|
|
|
|
Yes, no problem.
Different framework versions can co-exist on the same computer peacefully.
Regards,
mav
|
|
|
|
|
sorry again,
Is there a built-in tool as part of the VISUAL STUDIO that will allow me to include the Framework as part of my installation.
i dont think i can build up something of my own..
Thanks again,
Ran.
R.Z
|
|
|
|
|
How do i set the start position of the childform that i open from my main form?
I dont' want it to be in the center of the parent form or FormStartPosition.CenterParent.
i want it to be set at 218,28 of the parent form
|
|
|
|
|
You need to set it manually, which means you need to set it AFTER you show the form. Otherwise, the framework moves it on you. So, you need to get the position of the parent form top and left, and add 218,28 to it
Christian Graus - Microsoft MVP - C++
|
|
|
|