|
Hello Luc,
But isn't there allways the problem, that the "Tab" leeds to loosing the Focus of the Control?
Luc Pattyn wrote: I stopped using .NET 1.x completely.
Oh no!
The last one (apart from me) left the ship!
All the best,
Martin
|
|
|
|
|
Martin# wrote: But isn't there allways the problem, that the "Tab" leeds to loosing the Focus of the Control?
There was and is a solution to these by using one of Control.IsInputChar
and Control.ProcessCmdKey
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Excellent!
All the best,
Martin
|
|
|
|
|
According to Microsoft compressed folders in windows uses the following .dlls
1) Dunzip32.dll: Responsible for decompressing files stored in a compressed folder or file when they are copied, extracted, or executed.
2) Dzip32.dll: Responsible for compressing files when they are put into a compressed folder or file.
I need these dlls for a Console project that directly uses them to compress and decompress .zip files.
But when i try to add any of the above dll's as a reference to my project in Visual Studio 2005 i get the ERROR: Reference could not be added. Please make sure that the file is accessible and that it is a valid assembly or COM object.
Can anybody help me ???
================================
Thanks();
|
|
|
|
|
You cannot add them as references because they are written in unmanaged code, so you need to import the methods from those libraries using the DllImport attribute.
Hope it helps.
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
Thanks a lot.
But I think by using System.IO.Compression the same functionality of Dunzip32.dll can be achieved.
================================
Wirth's law: Software gets slower faster than hardware gets faster.
|
|
|
|
|
JSSUML wrote: Can anybody help me ???
Instead of trying to use these DLLs directly. Why not have a look in the System.IO.Compression[^] namespace for managed classes that do the same work.
|
|
|
|
|
Thanks. that works well
================================
Wirth's law: Software gets slower faster than hardware gets faster.
|
|
|
|
|
Hi all,
I am having an error and an doubt.
In my applicaiton i am sending automatic mail. In that whn i use
SmtpMail.SmtpServer = " localhost" , there is no issue for me. But while using the
SmtpMail.SmtpServer = " smtp.your-server.com" , mail is not sending/reciving for me. I got the sample from some other forums.
Plz some one explaion wht is the problem, and how to solve i. Also suggest me in which suitation i have to use localhost and hich suitation i have to use smtp.servername.com.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
First check to see if the "smtp.your-server.com" is reachable from your workstation.
Try ping smtp.your-server.com from command prompt.
If it does not suceed that means there is no direct connection to smtp.your-server.com and you will probably have to use a relay server to send your mail.
================================
Thanks();
|
|
|
|
|
Hi,
while tranporting from eccel file to datatable all the fields are coming correctly except one field which is not coming if it is having numbers, if it is having string than it also coming correctly.
while other columns are coming correctly in all the cases either it is having string or numbers.
Thanks in advance,
Vijay Kumar
Software Engineer
|
|
|
|
|
Have you fixed this yet?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
foreach(DataRow dr in dataset.Tables["principal"].Rows)<br />
{<br />
if (dr["name"].ToString()==szPrincipal_name)<br />
{<br />
nPrincipal_Id = Convert.ToInt32(dr["principal_Id"].ToString());<br />
bEncontrou = true;<br />
break;<br />
}<br />
nPrincipal_Id++;<br />
}
_labelRowDeleted:<br />
foreach (DataRow myRow in dataset.Tables["grant"].Rows)<br />
{<br />
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())<br />
{<br />
myRow.Delete();<br />
goto _labelRowDeleted;<br />
}<br />
}
Solutions are welcome.
|
|
|
|
|
How about this?
bool finished = false;
while (!finished)
{
try
{
foreach (DataRow myRow in dataset.Tables["grant"].Rows)
{
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())
{
myRow.Delete();
throw new Exception();
}
}
finished = true;
}
catch
{
finished = false;
}
}
Just an ideea
There are 10 kinds of people: those who understand binary and those who don't
|
|
|
|
|
You should NEVER throw an exception unless it is an EXCEPTIONal case (the hint is in the name). This is plainly not an exceptional case. This is an even worse solution to the one that calls goto.
|
|
|
|
|
Bummer8 wrote: _labelRowDeleted:
foreach (DataRow myRow in dataset.Tables["grant"].Rows)
{
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())
{
myRow.Delete();
goto _labelRowDeleted;
}
}
do
{
bool restart = false;
foreach (DataRow myRow in dataset.Tables["grant"].Rows)
{
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())
{
myRow.Delete();
restart = true;
break;
}
}
}
while (restart == true);
Although I'm not entirely sure why you are starting the loop over again when you are deleting a row.
I would imagine the following would have the same effect and be more efficient (by traversing the rows backwards)
DataRows rows = dataset.Tables["grant"].Rows;
for(int i=rows.Length-1; i>=0; i--)
{
DataRow myRow = rows[i];
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())
{
myRow.Delete();
}
}
|
|
|
|
|
try this...
do
{
foreach (DataRow myRow in dataset.Tables["grant"].Rows)
{
if (myRow["principal_Id"].ToString() == nPrincipal_Id.ToString())
{
myRow.Delete();
continue;
}
}
break;
}while(true);
================================
Thanks();
|
|
|
|
|
Why start over every time you find a row? Just store the rows you want to delete, and do it separately.
List<DataRow> removal = new List<DataRow>();
foreach (DataRow row in dataset.Tables["grant"].Rows) {
if ((int)row["principal_Id"] == nPrincipal_Id) {
removal.Add(row)
}
}
foreach (DataRow row in removal) {
row.Delete();
}
---
single minded; short sighted; long gone;
|
|
|
|
|
Well, none of your solutions work. most give errors. Maybe guffa's will, if he get's his code working (<DataRow> <--- what's this supposed to be).
|
|
|
|
|
Templating. a C# 2.0 feature.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
Bummer8 wrote: Maybe guffa's will, if he get's his code working
Gets HIS code working?? Who getting paid to write the code?? Hint, it's NOT Guffa...
Guffa's code works, for .NET 2.0 and above. Apparently you're using .NET 1.1 or below. Colin's will work on .NET 1.1. In either case, they both will work, based on the very limited information you've given. It's up to you to apply the concepts demonstrated to your exact situation.
Buddy, that is what you're getting paid to do!
BTW: Your code looks like it's trying to enforce referential integrity in a database. This is something that's better left up to the database itself.
And, I haven't used a Goto for any reason what-so-ever, in any language, in, what, the last 12 years...
|
|
|
|
|
Hey!
I am trying to set the Enable-property of a toolstripstatuslabel on a statusstrip through an event and I am getting the error message "InvalidOperationException was unhandled, Cross-thread operation not valid....".
On other controls I would solve this by using the control.BeginInvoke() method but there is no such method for a toolstripstatuslabel.
I yes, I want to have CheckForIllegalCrossThreadCalls set to true.
Anyone who has an idea how to solve this?
|
|
|
|
|
I'm not sure what you're taking about but it seems like you want to disable some tool tips from appearing which can be easily archived by excluding them from your controls and adding them again once needed so focus on the associated control not the tooltip itself
and...
Hampus@foi wrote: CheckForIllegalCrossThreadCalls
Is a bad practice in threads so try to skip it by all means!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
can u pl tell me how to implement custom desktop thro' c#? i want to customize desktop on lan machines..
|
|
|
|
|
You can do it by editing the right registry values, however, for most changes to take place, the user will have to restart.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|