|
hi there,
I'm pretty sure that there are a lot of great article on CP site
below is just one of them:
http://www.codeproject.com/dotnet/phonebook.asp
<< >>
|
|
|
|
|
You're lucky, you don't need to implement a hash table, the .NET FCL already has one (System.Collections.HashTable).
Or you can try SortedList[^] instead.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can we create custom shaped Windows Forms in C#.NET
KHALID
|
|
|
|
|
|
I am ishtiaq. i am working at a project in which i am trying to use C for making windows base application.
i have two problems.
1. i am seeking such a funtion to whome i can use of inputting data from the user and then display it as out put back to the screen. the function outtext() or outtextxy() do not perform in put values from user.
2. and the other method for takig input is to use Window () function but we can use it with viewport() function but i am fail to use these both function window() and viewport() together.as microsoft word provide and there is not any example in any book that i have read yet.
please send me any code that will be use for that one.thanks a lot
my email address is imtiaztkd@yahoo.com bye
ishtiaq ahmad from pakistan
E/668, shah rukn-e-alam colony , Multan, pakistan
|
|
|
|
|
Sorry if it's a bit silly, I'm just learning. I have code that looks like
textBoxHomePhone.Text = node.InnerText;
node = contactNode.SelectSingleNode("WorkPhone");
Now only the first line (till 'the extension') appears in the task list. I don't want to merge the lines since it would run off the screen. Adding HACK: to the succeeding lines creates multiple tasks. Is it possible to do something wherein the whole comment would appear as a single task?
Help is appreciated!
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
It's possible to create a multiline comment by using the /* comment */ notation.
The bigger issue is that the task list is a grid, and it appears that you only get one line per task (everything up to the fist newline character), so even creating something like
while it is technically a single comment, will not appear all on the single line provided by the task list.
You are better off just using that first line (everything following the 'HACK:' tag as a descriptive title for the rest of your comment. That way its appearance in the task list will give the developer(s) an idea what the task is about.
Since navigating to tasks is as simple as double-clicking, it's not worth getting too excited about the shortcomings of this feature, IMO.
Hope this helps,
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Thanks for the tip, Turbochimp - I'll do as you suggest.
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
Hi guys.
i new in c#, now there a pro..
i currently writin a pro to check so value for some number.
problem is before i do that i check for any alphahent in e number input.. cos for my case only number.
But the problem is if i key in "MMM" the thing get stuck in a for loop for three time.
is there a command like C.. EXIT where they exit the program immendiate
|
|
|
|
|
If it's a Windows app, simply call Application.Exit() .
If it's a console app, you can use return; or return 0; depending on your declaration of Main().
HTH.
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
if by using return it goes back to where the loop is..
i wanna break out of that loop and exit the program.. or is there a way to clear all the input in the program
|
|
|
|
|
You can explicitly terminate a console app by calling Environment.Exit() . Look at this:
using System;
class Class1
{
public static int Main(string[] args)
{
Console.WriteLine("Hello");
Environment.Exit(0);
Console.WriteLine("Bye");
return 0;
}
}
However, I do not know how 'safe' it is to call that method. HTH.
Cheers,
Vikram.
http://www.geocities.com/vpunathambekar
Google talk: binarybandit After all is said and done, much is said and little is done.
|
|
|
|
|
not sure of your explanation
if you are trying to break a loop, i *really* dont like he break keyword except for switch (but that is just me) i like o gracefully exit a loop like this
<br />
bool found = false;<br />
<br />
while(!found )<br />
{ <br />
if(condition)<br />
{<br />
found = true;<br />
}<br />
}<br />
<code><br />
<br />
hth<br />
g00fy<br />
<br />
-- modified at 5:13 Friday 16th September, 2005
|
|
|
|
|
in C# webform i get the value in javascript ,i want send value to next webform through the javascript
m mohamad rafi
|
|
|
|
|
Put the value in a hidden field.
---
b { font-weight: normal; }
|
|
|
|
|
The program is to use PocketPC to connect the web service and get the dataSet and display to dataGrid.
But I can't find method like "setDataBind", how to show the dataSet to DataGrid??
The code is as follow:
private void button1_Click(object sender, EventArgs e)
{
localhost.Service service = new DeviceApplication2.localhost.Service();
service.BeginEmployeeDataSet(new System.AsyncCallback(WriteDataSet), service);
}
private void WriteDataSet(System.IAsyncResult oRes)
{
localhost.Service service = (DeviceApplication2.localhost.Service)oRes.AsyncState;
System.Data.DataSet ds = service.EndEmployeeDataSet(oRes);
}
|
|
|
|
|
You should use
DataGrid.DataSource = dataSet;
Live Life King Size
Alomgir Miah
|
|
|
|
|
I'm tring to think of a fast way to perform a string search on a treeview. I'm reading in a hierarical CSV file and inserting it into a tree for easy viewing. For some elements of my code I need to find "needle" in this giant haystack. I've thought of extending the treeview to integrate with a ternary search tree of some sort, but that seems really complicated to me. Linear searches of the tree seem like a really bad idea considering my CSV is in upwards of 9,000 lines. It's a lot of data so I need a fast way to search. I'd prefer to have an array with the keys indexed as unique strings. Good/bad idea? I'm pretty new to c# and this is proving much more difficult than I thought it would.
Any suggestions or examples would be greatly appreciated!!
|
|
|
|
|
I found this on the msgboard - any other suggestions or is there a faster way?
http://www.codeproject.com/script/comments/forums.asp?msg=1164592&forumid=1649&ForumID=1649&XtraIDs=1649&searchkw=treeview&sd=6/17/2002&ed=9/15/2005&Page=2#xx1164592xx
|
|
|
|
|
|
I think the problem is in setting the bool. But obviously I don't really know
or I wouldn't be posting this......thanks...
public class Form1 : System.Windows.Forms.Form
{
//member fields.....
public Complex2 complexA;
public Complex2 complexB;
public bool bShowValue;
Pen activePen;......
///////////////////////////////////////////////////////////////////////////////
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
DoThis(e.Graphics);
DoThat(e.Graphics);
if(bShowValue)
{
DrawComplexNumber(this.CreateGraphics(), activePen, this.complexA.Real, this.complexB.Imaginary) ;
}
////////////////////////////////////////////////////////////////////////////////
private void complexA_OK_Click(object sender, System.EventArgs e)
{
Graphics g = this.CreateGraphics();
Pen activePen = new Pen(Color.Coral, 4);
try
{
bool bShowValue = true;
this.complexA.Real = Convert.ToDouble(this.textComplexAReal.Text);
this.complexB.Imaginary = Convert.ToDouble(this.textComplexAComplex.Text);
DrawComplexNumber(g, activePen, complexA.Real, complexA.Imaginary);
}
catch
{
MessageBox.Show("Invalid Complex A Number", "Error!");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void DrawComplexNumber(Graphics g, Pen activePen, double re_, double im_)
{
g.DrawLine(activePen, (xIndent + graphRect.Width/2), (yIndent + graphRect.Height/2),
(xIndent + graphRect.Width/2) + (float)(re_ * xIndent), (yIndent + graphRect.Height/2) - (float)(im_ * yIndent));
}
private void button1_Click(object sender, System.EventArgs e)
{
Invalidate();
}
|
|
|
|
|
Anonymous wrote:
Graphics g = this.CreateGraphics();
Pen activePen = new Pen(Color.Coral, 4);
What on earth is this ? You should do ALL drawing in your paint method
What does 'blows sky high' mean ? It would help if you told us the actual error, and the line that causes it. Best guess, based on a lack of info, is that your convert.todouble call fails because a text box is empty, or contains a string that can't convert into a number.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry about that...I thought that this code was an earlier version that I was running....
This code compiles/runs-- but it needs to be debugged. I'm still learning
how to navigate the debugger.
Problem_1: I enter NUMBERS(not letters etc...) into the text boxes and hit OK button--> Keep getting the MessageBox in the catch block.
i.e. bShowValue = false; ALL the time.
Problem_2.
What on earth is this ?
I see your point. I'm out of scope?
If all drawing must be in paint method, perhaps it would be best to create an
array of pens INSIDE the paint method inside a for(...) loop? No?
|
|
|
|
|
Anonymous wrote:
Problem_1: I enter NUMBERS(not letters etc...) into the text boxes and hit OK button--> Keep getting the MessageBox in the catch block.
i.e. bShowValue = false; ALL the time.
Use F9 to set a break point at the start of the function. Make sure you're in debug mode ( Build/Configuration Manager ), then hit F5 to start debugging. I believe it's F5 also to step to the next line, a right click will give you the option and show you the keys in any case.
Anonymous wrote:
If all drawing must be in paint method, perhaps it would be best to create an
array of pens INSIDE the paint method inside a for(...) loop? No?
Your paint method should be able to tell via a flag if it should draw a number, then call the draw method that you're calling now. Why do you need an array of pens ? If they are always the same, one pen should be a member variable ( which means you need to impliment IDisposable and dispose of it )
Christian Graus - Microsoft MVP - C++
-- modified at 22:56 Thursday 15th September, 2005
|
|
|
|
|
Christian Graus wrote:
If they are always the same
They're not.I need many different colored lines, so each button click that is associated with the text boxes--> btn OK needs to effectively fire
g.DrawLine... w/ a different color.
thanks for your help! I will work on this....I'm sorry I'm so disorganized but I'm trying to learn this by trial and error....
|
|
|
|