6
Answers

CAD tool development using c#

madhuri hubli

madhuri hubli

13y
13.3k
1
I am c# programmer,i want to develop a CAD like tool(2D or 3D) for drawing(Lines,circle,polygon,cubes).i don't know how to start,can any one help me so that ill start my project,deadline is may.any reference or links so that ill start as soon as possible plz..
features:
1)user will draw rooms of a house for example using the GUI provided by the tool which we are developing.
2)event handling for data  collection (optional).
Answers (6)
1
Prem Anandh Natchatran

Prem Anandh Natchatran

NA 678 6.6k 9y

Attachment listvew.rar

Hi sarava,
 
 Try the following,
Add a list view control and text box  in your form and paste the following code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//Prem Anandh Natchatran
namespace ListVew
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "0";
textBox1.Enabled = false;
listView1.View = View.Details;
listView1.GridLines = true;
listView1.FullRowSelect = true;

//Add column header
listView1.Columns.Add("ProductName", 100);
listView1.Columns.Add("Price", 70);

//Add items in the listview
string[] arr = new string[2];
ListViewItem itm;

//Add first item
arr[0] = "Tea";
arr[1] = "20";
itm = new ListViewItem(arr);
listView1.Items.Add(itm);

//Add second item
arr[0] = "Coffee";
arr[1] = "25";
itm = new ListViewItem(arr);
listView1.Items.Add(itm);
//Add Third item
arr[0] = "CoolDrinks";
arr[1] = "35";
itm = new ListViewItem(arr);
listView1.Items.Add(itm);
//Add fouth item
arr[0] = "Juice";
arr[1] = "55";
itm = new ListViewItem(arr);
listView1.Items.Add(itm);

}

private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
ListView.SelectedListViewItemCollection breakfast =
this.listView1.SelectedItems;

double price = 0.0;
foreach (ListViewItem item in breakfast)
{
price += Double.Parse(item.SubItems[1].Text);
}
price=int.Parse(textBox1.Text) + price;
// Output the price to TextBox1.
textBox1.Text = price.ToString();
}
}
}
Output form
 
  I have attached the source code also.. Keep trying all the best..
 
-------------------------------------------------------------------
If you find anything useful please accept my answer
 
 
 
 
 
 
Accepted
0
Prem Anandh Natchatran

Prem Anandh Natchatran

NA 678 6.6k 9y
Thanks for your appreciation..
 The code will work in VS2013 also
You did't triggered the event
listView1_SelectedIndexChanged(object sender, EventArgs e)
 choose the listview and double click the SelectedIndexChanged Event in property window then only the particular event will be generate.
It will work...
 
 
0
Sarva Siddartha

Sarva Siddartha

NA 16 3.3k 9y

Attachment listroom.rar

Thanks but, I am having visual studio express 2013. I am not getting the cost of the selected items in my textbox.