ShowDialog? Dialog losing focus.

  • Thread starter Thread starter Wapiti
  • Start date Start date
W

Wapiti

I created my own msgbox (frmMsgBox) because my users want to use their
fingers (gloved) when in the field - the standard msgbox has too small of
buttons

My code calls this custom msgbox using me.showdialog() within its own public
function "Display" (see below). It may not be the best way of doing it, but
it has been working --- until now. I'm finding that every once in a while,
the displayed msgbox form loses focus and is tucked behind the calling form.
Never to be found again by a user unless I get called and look at Start |
Settings | System | Memory | Running Programs. Its running, but not
displaying on top. I can't seem to recreate it so I can continuously
duplicate it. I know the code below may not be much help, but maybe??

Please feel free to ask if I can help clarify.... after doing some ng
searches, maybe this is a known issue. Not seeing any answers, nor
resolution, though.

Thanks,

Mike

Forms call frmMsgBox as such:

modGlobal.bas contains:
<snip>
public fMsgBox as new frmMsgBox 'Initiate the form
<snip>

frmMsgBox:
<snip>
'Public function that other forms use to open this msgbox form
public function Display (<setup_parms>) as msgboxReturnResults 'this return
value is a public enum
<snip>
me.ShowDialog()
Return rtn
End Function

frmTest:
<snip>
If fMsgBox.Display("Hello World", frmMsgBox.msgboxButtonTypes.YesNo) =
frmMsgBox.msgboxReturnResults.clickedYes Then
'do something
EndIf
<snip>
 
Does this mean that ShowDialog doesn't work as it should? Or do I have the
function of ShowDialog confused?

I thought it would show a modal form.
 
Its not guaranteed to be top most and in some circumstances focus can return
to your calling form before the dialog is fully displayed, I use this
top-most technique in my own custom messagebox which is running in an
environment where other applications can come to the foreground so it
guarantees your form is top of the z-order.
Another option is to forcably hide the calling form and then show it again
when the dialog is dismissed.

Peter
 
Thanks for clarifying that Peter.

Now, I worry about the response I might get for this one, but I gotta learn
somehow I guess.

In MY other projects, I've referenced the OpenNetCF libraries (termonology
correct?) - and its been great. However, I attempted this on this current
project ( where i'm not the sole developer ) and the team was quite unhappy
to find that they needed to install OpenNetCF on each developers PC to make
code changes to the app.

I hear that I can integrate the OpenNetCF source into my project somehow to
prevent having to reference OpenNetCF from each developers PC (What is so
difficult about that, I don't know). Is this correct? We're using VB, not
C.

Are there any help files to explain how to do this? Every attempt I've made
has failed.

Thanks for all your work in this,

Mike
 
When I enter this code, usign OpenNetCF - the first time I pop up this
msgbox form, it works perfectly. However, the next times, the form won't go
away. I use me.close in my button code. ?
 
Sounds like you basically have a VB exe and a C# dll. You won't have much
luck merging those with the CF and VS. You are pretty much stuck with
convincing your colleagues that componentising an application into multiple
files is not a bad thing. And if one of those files happens to be a 3rd
party dll then it is not a problem.

Either that or pick the relevant areas of the openetcf code and translate
them to VB.

Cheers
Daniel
 
Thanks for confirming that for me Danial. I ended up forcing the idea
through the team, they're still not happy, but I wasn't about to put
countless effort toward writing what was already written - told them it was
that, or lots of overages in time. I won.

Thanks again.
 
Back
Top