Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help me on ProcessCmdKey Pin
12Code6-Apr-09 18:22
12Code6-Apr-09 18:22 
GeneralRe: Help me on ProcessCmdKey Pin
janas997-Apr-09 16:54
janas997-Apr-09 16:54 
GeneralRe: Help me on ProcessCmdKey Pin
12Code7-Apr-09 17:43
12Code7-Apr-09 17:43 
QuestionBreak a Method??? Pin
S K Y6-Apr-09 15:41
S K Y6-Apr-09 15:41 
AnswerRe: Break a Method??? Pin
N a v a n e e t h6-Apr-09 15:45
N a v a n e e t h6-Apr-09 15:45 
GeneralRe: Break a Method??? Pin
S K Y6-Apr-09 16:30
S K Y6-Apr-09 16:30 
GeneralRe: Break a Method??? Pin
N a v a n e e t h6-Apr-09 16:43
N a v a n e e t h6-Apr-09 16:43 
QuestionProblem with the ListView control [modified] Pin
Ankit Rajpoot6-Apr-09 14:55
Ankit Rajpoot6-Apr-09 14:55 
Hello everybody,

My application uses a ListView control to display a list of files. Everything works fine except that when I set the
View property of the ListView to View.List, the list appears but, here's[^] a screenshot of how it looks. I can't understand,
why the filenames are condensed and appended with a "...". I've searched
google and msdn, but couldn't found a solution for the problem. The Large Icon[^] and Details Views[^]
are working perfectly. Just the list view is misbehaving.

My second problem is regarding a BackgroundWorker. I have a BGWKR that I'm using to perform a database transaction.
Now the problem is that the user may close the form while the transaction is in progress.
To handle this, I added code to the form's closing event handler, to inform the user that a transaction is active and ask
him/her, whether to cancel it. If the user affirms, then a call to BGWKR.CancelAsync() is made. Here's the form_closing event.

private void WndSearchResults_FormClosing(object sender, FormClosingEventArgs e)
{
    if (bgDatabaseSearcher.IsBusy)
    {
         if (MessageBox.Show(Resources.msgSearchActive_WindowClosing, "Question",
 MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
         {
             e.Cancel = true;
             return;
         }
         else
         {
             bgDatabaseSearcher.CancelAsync();
             while (bgDatabaseSearcher.IsBusy) 
                  Thread.Sleep(500);
         }
    }
}


Here's the BGWKR's Do_Work event
private void bgDatabaseSearcher_DoWork(object sender, DoWorkEventArgs e)
        {
            VFS virtualFS = new VFS();

            foreach (ListEntry entry in imagesToSearch)
            {
                try
                {
                    virtualFS.OpenConnection(Path.Combine(AppSettingsManager.ImagesDirectory, entry.imageDbPath));
                    foreach (VFSSearchTerm searchTerm in termsToSearch)
                    {
                        virtualFS.SearchVFS(searchTerm, searchOptions, SearchResultProcessor, entry.imageID);
                        if (bgDatabaseSearcher.CancellationPending) /* The control 
doesn't reach this point if a call to CancelAsync() has been made from the form closing event. */
                        {
                            virtualFS.CloseConnection(true);
                            return;
                        }
                    }
                }
                finally
                {
                    virtualFS.CloseConnection(true);
                }
            }
        }


However, the DoWork methods cancels gracefully if CancelAsync() is called from a button's click event handler.

Please help.
Thanks

Excuse me for buttin' in, but I'm interrupt driven.

modified on Monday, April 6, 2009 11:27 PM

AnswerRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 15:20
sitebuilderLuc Pattyn6-Apr-09 15:20 
GeneralRe: Problem with the ListView control Pin
Ankit Rajpoot6-Apr-09 16:04
Ankit Rajpoot6-Apr-09 16:04 
AnswerRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 16:35
sitebuilderLuc Pattyn6-Apr-09 16:35 
GeneralRe: Problem with the ListView control Pin
Ankit Rajpoot6-Apr-09 17:28
Ankit Rajpoot6-Apr-09 17:28 
GeneralRe: Problem with the ListView control Pin
Luc Pattyn6-Apr-09 17:47
sitebuilderLuc Pattyn6-Apr-09 17:47 
GeneralRe: Problem with the ListView control Pin
Ankit Rajpoot7-Apr-09 2:44
Ankit Rajpoot7-Apr-09 2:44 
QuestionWebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
abiemann6-Apr-09 13:36
abiemann6-Apr-09 13:36 
AnswerRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
N a v a n e e t h6-Apr-09 15:51
N a v a n e e t h6-Apr-09 15:51 
GeneralRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
abiemann9-Apr-09 8:50
abiemann9-Apr-09 8:50 
GeneralRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
abiemann9-Apr-09 9:12
abiemann9-Apr-09 9:12 
GeneralRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
abiemann10-Apr-09 13:58
abiemann10-Apr-09 13:58 
GeneralRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
ishant78907-Jul-10 20:35
ishant78907-Jul-10 20:35 
GeneralRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
eeidfn4-Oct-10 8:56
eeidfn4-Oct-10 8:56 
AnswerRe: WebRequest.GetResponse() = error (407) Proxy Authentication Required Pin
ebjean22-Jul-10 2:34
ebjean22-Jul-10 2:34 
QuestionOPC communication in c# Pin
AlessandroOPC6-Apr-09 11:29
AlessandroOPC6-Apr-09 11:29 
QuestionSystem.ArgumentException: The value of DatagridviewComboboxCell is invalid Pin
Priya Prk6-Apr-09 9:41
Priya Prk6-Apr-09 9:41 
QuestionNeed help with binding source Pin
faizych6-Apr-09 9:09
faizych6-Apr-09 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.