Click here to Skip to main content
15,904,155 members
Home / Discussions / C#
   

C#

 
GeneralRe: Sequential structure code Pin
BabyOreo6-Apr-09 21:26
BabyOreo6-Apr-09 21:26 
AnswerRe: Sequential structure code Pin
DaveyM697-Apr-09 0:42
professionalDaveyM697-Apr-09 0:42 
QuestionInput data to label through textbox Pin
ciqing6-Apr-09 17:46
ciqing6-Apr-09 17:46 
AnswerRe: Input data to label through textbox Pin
Luc Pattyn6-Apr-09 17:52
sitebuilderLuc Pattyn6-Apr-09 17:52 
GeneralRe: Input data to label through textbox Pin
ciqing6-Apr-09 19:30
ciqing6-Apr-09 19:30 
GeneralRe: Input data to label through textbox Pin
Christian Graus6-Apr-09 20:01
protectorChristian Graus6-Apr-09 20:01 
GeneralRe: Input data to label through textbox Pin
ciqing6-Apr-09 20:37
ciqing6-Apr-09 20:37 
GeneralRe: Input data to label through textbox Pin
Luc Pattyn7-Apr-09 3:00
sitebuilderLuc Pattyn7-Apr-09 3:00 
QuestionPopup Outlook contact makes the WinForm stuck and hold Pin
manfree6-Apr-09 17:32
manfree6-Apr-09 17:32 
AnswerRe: Popup Outlook contact makes the WinForm stuck and hold Pin
Shajeel6-Apr-09 21:12
Shajeel6-Apr-09 21:12 
GeneralRe: Popup Outlook contact makes the WinForm stuck and hold Pin
manfree6-Apr-09 22:00
manfree6-Apr-09 22:00 
QuestionHelp me Pin
janas996-Apr-09 17:19
janas996-Apr-09 17:19 
AnswerRe: Help me Pin
N a v a n e e t h6-Apr-09 17:45
N a v a n e e t h6-Apr-09 17:45 
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 

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.