|
of course my dear but it will give a bit help
|
|
|
|
|
Thanks shabonaa,
This has given me a good place to start.
Thanks,
Guytz
|
|
|
|
|
hello,
how can i get the (display)width of a text in any font.
i want to develop something like autosize of the label
|
|
|
|
|
You have to use a great function provided by the Graphic class named: MeasureString. I use that to write text in my chart webcomponent...
check this article:
http://www.codeproject.com/cs/media/measurestring.asp
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
the Graphics object has a method to measure text - it is not 100% accurate, but is pretty good.
If im not mistaken their are windows API calls for the same purpose - some knowledgable person will no doubt be along to point them out!
|
|
|
|
|
how to write check value in textbox
when user input value in textbox
and i unwanted input value number in textbox
input character only
can i write code for check?
thanks
Preaw
|
|
|
|
|
i remember that use c# for window application
Preaw
|
|
|
|
|
This is not very legible, but I think you want to validate input ? You can handle the KeyPressed event and set e.Handled to true if you want to reject the keypress, or use a MaskedTextBox
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I was not sure if you were asking this of a Web Form or a Win Form. I would use a custom validator control if it is a Web Form, but the below will work for both.
private void btnCheck_Click(object sender, EventArgs e)
{
bool Numeric = IsNumeric(txtNonNumeric);
}
private bool IsNumeric(string strText)
{
try
{
Convert.ToDouble(strText);
return true;
}
catch
{
return false;
}
}
|
|
|
|
|
Hello,
I have a Windows ListView, whose view is set to "List" and then it shows an icon in front of each item and some text in front of it.
The problem is that its showing only first few characters of the text.
Does anybody know to increase the size of this label/text for each item, so that it can atleast show 12 characters.
Thanks
|
|
|
|
|
The ListView has an Items collection, you can use this to set the width of an item, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks for replying.
There is no such or similar property.
|
|
|
|
|
|
Yes, there is, but it's not what you want
listView1.Columns[0].Width = 20;
Is how you set column width.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes there is offcourse Items property but I meant that there is no property on it by which its size, etc can be changed.
Increasing the column widths will do.
Thanks for the quick responses.
Cheers
|
|
|
|
|
Hi,
Is there any other way of increasing the label size other than increasing the column widths?
Thanks
|
|
|
|
|
I have build a server application with Sockets. My question is simple.
Is it possible to see how many and what clients are connected? If yes then how?
Kind Regards ,
Jacco
|
|
|
|
|
I always keep track of the connected client sockets, so that I can disconnect them at will, for example to restart the server in a correct manner. If you keep track of the connected client sockets, you can simple get the size of the list which gives you the number of connected clients.
WM.
What about weapons of mass-construction?
|
|
|
|
|
hi
i found an article in codeproject as DataGridPrinter that print datagrid good. but it has written with VB.Net and i want it in csharp. when i create dll in VB.Net and i use it in c# the following error shown me :
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'
and when i set Datagrid1.DataSource = ds1.Tables["Table1"]; the following error shown me :
//in Line 374
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
how to solve my problem and do you have a other class that print datagrid in C# with header and footer ?
thanks ..
|
|
|
|
|
There is a forum provided under the article, that's the place to go to get help on the article.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
How to play a sound from my program.
I have Visual Studio 2003.
Net 1.0.]
Help.
Vasildb
|
|
|
|
|
using System.Runtime.InteropServices;
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern int Beep(int dqFreq, int dqDuration);
Beep (3000,25);
=> It will play a nice beep like in '80 years
If you are not happy with that you can also use the MCI functionalities provoded by the API (need import also)
or ... simply play wave with:
[System.Runtime.InteropServices.DllImport("Winmm.dll")]
private static extern bool PlaySound(byte[] data, IntPtr hMod, UInt32 dwFlags);
La Richesse & la Gloire ne griseront jamais que les temples
|
|
|
|
|
hi ,
i writing a application in that i want to read or send data to one port(COM2)
i using C#.net2003 thatwhy i can't use
namespace SerialPort
i must use win32 API
plz give a sample program for sending the data to COM2 port in C#.net
it's very usefull in my application plz
Thanks
|
|
|
|
|
Could someone point out why there is an error here?
Thanks.
class BankAccount<br />
{<br />
<br />
decimal m_ID;<br />
<br />
public BankAccount(string ID)<br />
{<br />
m_ID = 0;<br />
}<br />
<br />
}<br />
class SavingsAccount : BankAccount<br />
{<br />
decimal m_ID;<br />
<br />
public SavingsAccount(string ID)<br />
{<br />
m_ID = 0;<br />
}<br />
}
|
|
|
|
|
Since the SavingsAccount ctor doesn't have an explicit call to the base class ctor, the compiler will insert a call to the default ctor (the one with no parameters). But there is no such ctor, so you get the error. You need to add the call to the initializer list:
public SavingsAccount(string ID) : base(ID) { ... }
|
|
|
|