|
is there a fix for this so called bug ?
i am getting my icons from Win32.SHGetFileInfo(), then adding it to an imagelist on a treeview, but they appear black where they should be transparent. i am not setting any transparent colour, but form what i remember last time i tried this it didnt do anything anyway.
is there a solution ?
kind regards,
g00fy
|
|
|
|
|
how can i find all the ZIP files in a particular directory and its subdirectories.
|
|
|
|
|
System.IO.Directory and System.IO.DirectoryInfo have methods for returning files and subdirectories (GetDirectories(), GetFiles() etc.) which you can use for this.
Are you looking for ZIP files just in the immediate subdirectories, or in all subdirectories of subdirectories of subdirectories etc?
Rob Philpott
|
|
|
|
|
|
It would be helpful if you informed us about the reason for your inability to convert the string.
If the string contains anything that can be converted to an int, it's easy:
myInt = Convert.ToInt32(myString)
---
b { font-weight: normal; }
|
|
|
|
|
Hello
May be you need to try this:
int.Parse( str )
or this:
Convert.ToInt32( str )
With best regards,
Andrew Kirillov, MCP x 3
Prize winner, August 2005
|
|
|
|
|
Hi all,
I have a richtextbox and a vertical scrollbar on the form
now when i enter text into the richtextbox after it exceeds it's height
the scrollbar for the richtext is shown and we can scroll the contents of the
richtext,
Now i want to hide this scrollbar and want the contents to be scrolled
using the vertical scrollbar that i have put on the form.
Any code or hint will be helpful
Thanks and Regards,
Pramod
|
|
|
|
|
set your scrollbars to 'none' and use the SendMessage API call to control the scrolling
e.g.,
<br />
using System.Runtime.InteropServices;<br />
<br />
private const int WM_SCROLL = 276;
private const int WM_VSCROLL = 277;
private const int SB_LINEUP = 0;
private const int SB_LINELEFT = 0;
private const int SB_LINEDOWN = 1;
private const int SB_LINERIGHT = 1;
private const int SB_PAGEUP = 2;
private const int SB_PAGELEFT = 2;
private const int SB_PAGEDOWN = 3;
private const int SB_PAGERIGTH = 3;
private const int SB_PAGETOP = 6;
private const int SB_LEFT = 6;
private const int SB_PAGEBOTTOM = 7;
private const int SB_RIGHT = 7;
private const int SB_ENDSCROLL = 8;
<br />
[DllImport("user32.dll",CharSet=CharSet.Auto)]<br />
private static extern int SendMessage(IntPtr hWnd, int wMsg,IntPtr wParam, IntPtr lParam);<br />
then call SendMessage() and the way you want to scroll
hope that helps
g00fy
|
|
|
|
|
Thanks for ur reply
but i want to know when we use the default scroll bar of
the richtextbox then how to know whether the scroll is up or down
hope u get ny problem
Thanks and Regards,
Pramod
|
|
|
|
|
Override the WndProc of your RichTextBox and catch the scrollin messages there.
Regards,
mav
|
|
|
|
|
Hi mav,
i have done the same thing but i'm not
able to catch the scrolling event of richtextbox there
it capture's the scroll event of the vertical scroll bar
that i have placed on the form
can u give any idea to catch the scroll event of
the Richtextbox in the wndProc Method
Thanks
Pramod
|
|
|
|
|
hi to all,
i am writing an app that lets users browse a folder. so they can perform several file/folder tasks on that folder and its subfolder/file.
i would like to be able to display teh folder stats when they open the top level folder.
at the moment, i am using directoryinfo and fileinfo and recursivley iterating the entire structure from the top level folder down, jsut to get the filesize.
is there a way to grab this from windows any quicker than this, cause if they select a drive ... well u know whats going to happen. i am also only building the tree structure that reflects the filesystem to a certain depth until they click to that depth i dont go any further.
if there is no other way to get folder size i might try creating the entire tree structure in the same recursive loop and see if the overhead is too much
any ideas pls??
regards,
g00fy
|
|
|
|
|
The total size of the contents of a folder is not stored anywhere. If you can get that information from the system, it will be doing exactly what you are doing yourself, recursively looping through every subfolder to sum up the file sizes.
---
b { font-weight: normal; }
|
|
|
|
|
thans for the reply,
i thought that after i posted, as i tried it on a folder and watched the count go up.
i just optimised my recursion and its working quite well now, it seems to beat the windows effort for the same folder on the same machine and i'm generating the tree for the structure as well. maybe windows is doing some indexing on the first size check as the next time you do it, it is faster.
thanx again,
g00fy
|
|
|
|
|
The reason it's faster on the second go, is that the most of the clusters containing the directory information is still in the disk cache. On the first go all the clusters has to be retrieved from the disk.
---
b { font-weight: normal; }
|
|
|
|
|
hi
I'm a complete learner about c# programming,I need some source code with the algorithm of case-based resoning.
pls help me
thanks in advance
|
|
|
|
|
Hi,
You need what is called a "switch" statement for "case based reasoning".
I would give you some code but what you are asking is so fundamental to almost any programming language
that I would suggest that you consult the MSDN help or any C# text (only so you really understand what you are doing). In addition,"case based reasoning (as you call it) is found in C, C++ C# etc..
so if you are looking for an easy way out you are cheating yourself
hope this helps.....
|
|
|
|
|
|
Hello again everyone. I am working on this project, and when the user clicks submit, while the page is loading to another page, I want that button to be disabled. I tried just going
<br />
<br />
Submit_Button.Enabled=false;<br />
but that didnt work while the page was loading, it only worked after a post back. Is there a way to immediately make it disabled after the user clicks it before it posts back while the page is loading?
|
|
|
|
|
Use javascript to disable it. As you disable the button you might need to post the form using javascript also, as you can't post a form using a disabled button.
---
b { font-weight: normal; }
|
|
|
|
|
I received lots of help last night trying to get text validated. Problem now is I can't "click out" of the 1st TextBox to the next one or close down the App. What to do?
private void textComplex_1Real_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
TextBox textBox1 = sender as TextBox;
if(textBox1 == null)
return;
if(textBox1.TextLength == 0)
return;
bool error = false;
try
{
cmplxValue1.Real = Convert.ToDouble(textComplex_1Real.Text);
//cmplxValue1.Imaginary = Convert.ToDouble(textComplex_1Imaginary.Text);
//this would be the next TextBox to validate
}
catch(Exception ex)
{
error = true;
}
finally
{
if(error)
MessageBox.Show("Error");
textBox1.SelectAll();
textBox1.Focus();
e.Cancel = true;
}
}
|
|
|
|
|
Hi,
I did not get what actually you are trying
to do.
Please could you specify what u want to achieve...
Regards,
Pramod
|
|
|
|
|
|
Instead of locking the user inside the textbox until it validates, do something else to show that the data in the textbox is wrong, like changing it's background color, and disable the ability to go further to use the text in the textbox (e.g. the next/send/submit/ok button).
---
b { font-weight: normal; }
|
|
|
|
|
i m working on my study project. i divided that in different modules, now i need to call one module from another module.
|
|
|
|