|
TextBox TxtBox = new TextBox();
TxtBox.TextChanged = \\Your event
this.Controls.Add(TxtBox);
Sathy
|
|
|
|
|
Hi,
all Controls are generated dynamically! When you use Visual Designer to add some Controls
to a Form, what really happens is the Designer adds code to some file
(such as myForm.Designer.cs) and that code gets executed by myForm's constructor.
So you can look at that code and see how it is done; you can write the same (or different)
code yourself.
|
|
|
|
|
how to check if a given xml file is well formed or not?
Gaurav
|
|
|
|
|
Easiest way might be just to open it in an XmlDocument - it will fail if it's not well formed I think....
|
|
|
|
|
wellformedness can be checked by the Browser itself. open the xml file in IE and you can find if it is wellformed or not. IE has a Parser(software for processing xml file)
Never Never Give up!
|
|
|
|
|
Is it possible to call a method from a library to the main program and if so how (see example). If it is not possible please let me know.
class Library1
{
// Cannot add reference to Exe
MethodA()
}
class Exe
{
// Reference to Library1
void MethodA()
{
a = b + c;
}
}
There is a reference to Library1 in Exe
I can not add a reference to Libray1 for Exe because I would get a circular reference therefore it can not see Exe. How can I solve this problem.
Thanks in advance,
Michael
|
|
|
|
|
You would have to delcare a delagate in the Library code - inform the Library of the Exe method which implements that delegate - i.e. have a method in the library which takes an instance of the Library delegate and then call that delegate from the library at the appropriate time....
|
|
|
|
|
Hi everyone . I have project to compression file but i don't know about The SharpCode.SharpZipLib.Zip and The IO.Compression, what is better than ? and what is best way for compression file ?
Thanks for your help. I hope ,i have reply soon.
Le Trung Hieu
modified on Thursday, January 10, 2008 10:36:24 PM
|
|
|
|
|
They are different protocols and offer different compression ratios. The SharpZipLib library will allow you to use a Zip protocol and compress multiple files into a single archive. The GZipStream will only compress a single file, but it usually offers a slightly better compression ratio.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
I'm considering switching to Vista but one thing I don't like is WMP 11 (puts all my music under the wrong artists and albums) so I want to make my own music player. I've searched Google but I haven't founda whole lot on how to play music files. I found this:
http://community.sharpdevelop.net/forums/t/3500.aspx
What I'm looking for is some was to play a song as a seperate Thread which I could pause, fast forward, rewind, stop on demand.
|
|
|
|
|
|
That looks useful. I'll take a look thanks.
|
|
|
|
|
I tried to open it but Visual Studio 2005 Pro said it doesn't support .csproj files.
Plus I can't run the exe's in the Debug folder.
|
|
|
|
|
Visual Studio 2005 does support .csproj files, unless you explicitly said not to install it during installation.
|
|
|
|
|
Yeah I know VS2005 supports .csproj files, I use C# all the time.
|
|
|
|
|
Judah Himango wrote: Perhaps the MediaElement class in WPF will help?
Does this not use WMP under the surface? Or just the Windows Media libraries.. I've always been unclear on that point.
It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein
|
|
|
|
|
It just uses the libraries that Windows Media Player uses. It does not create an instance of Windows Media Player itself to play the files.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
The axwindowsmediaplayer in Vis .NET 2008 does this quite easily.
|
|
|
|
|
Hi all,
Well i want to draw a State Transition Diagram for my Java Application. Does any one got idea if there is any specific tool to create this diagram or do we have to do it on a paper.
Sorry for posting it here.
Thanks
James
|
|
|
|
|
Interesting. Posting a request for a Java application in the C# forum. Hoo boy - you must really want people to flame on you about this.
Anyway - you can do State Transition diagrams in Visio. You need to create a UML diagram and then select the UML Statechart tab in the shapes selection.
|
|
|
|
|
Hi
I came across this problem while working on a loop which selects from a datatable. I am selecting from a datatable which has about 31K records. I am checking to see if a column value is null. If I am not selecting based on COLUMN IS NULL, then datatable.Select method works nice. However, if I look for null column values, the speed decreases substantially(i.e from seconds to about 30 to 40 minutes).
I found a work around by replacing all null values with empty strings which solved the problem. However, if datatable column type was something other than string then this solution would not work.
I was wondering if someone has an idea about this.
Here is the sample of my code:
I have replaced the dt datatable col4 values with empty strings for now(for better performance. I want to find a better way of doing select). As a result, the code looks like this.
foreach (DataRow dr in dt.Rows)//31K records
{
col1 = dr["col1"].ToString().Trim();
col2 = dr["col2"].ToString().Trim();
col3 = dr["col3"].ToString().Trim();
col4 = dr ["col4"].ToString().Trim();
if (col4 == "") // if column4 is null then use this
{
recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 = ''");
//recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 is null"); <--very slow due to col4 is null
}
else
{
recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " col3 = " + "'" + col3 + "'" + " And col4 = " + "'" + col4 + "'");
}
}
Thanks
Needy
|
|
|
|
|
did you try
<br />
col1 = dr["col1"].ToString().Trim();<br />
col2 = dr["col2"].ToString().Trim();<br />
col3 = dr["col3"].ToString().Trim();<br />
<br />
if( dr["col4"] == DBNull.Value )<br />
{<br />
recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 = ''"); <br />
}<br />
else<br />
{<br />
col4 = dr ["col4"].ToString().Trim(); <br />
recordsSelected = dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " col3 = " + "'" + col3 + "'" + " And col4 = " + "'" + col4 + "'");<br />
}<br />
|
|
|
|
|
I already tried that. If you read my post I have that select line already in my code. I want to find out a work around. I replaced all nulls to the empty strings. However, this approach may not work if a column i am looking for is not string. As a result, if someone knows a better way or other way to select if values are null in datatable.
Thanks
Needy
|
|
|
|
|
bemahesh wrote: I already tried that. If you read my post I have that select line already in my code. I want to find out a work around. I replaced all nulls to the empty strings. However, this approach may not work if a column i am looking for is not string. As a result, if someone knows a better way or other way to select if values are null in datatable.
I can't image that a real null value in the column, and comparing that to DBNull.Value would take longer than doing the string comparision you are doing now. What you are doing sounds like bad design work. I think you need to go back, and set all those columns to null, and compare them to DBNull.Value .
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
If I was not clear enough, the problem is when i am trying to select the data from datatable using datatable.select(). If i have null value in one of the column in datatable and i am selecting from the datatable like: datatable.select("col4 is null").
That is where it takes longer time.
Please, look at my original post
this line is not creating overhead: if (col4 == "") // if column4 is null then use this
But, this line does:
dt.Select("col2 = " + "'" + col2 + "'" + " And col1 = " + "'" + col1 + "'" + " And col3 = " + "'" + col3+ "'" + " And col4 is null");
Thanks
Needy
|
|
|
|