|
hi Rupesh,
which method do you use for opening forms!?
you should use showdialog() instead of show() method
|
|
|
|
|
hi dear,
Thank you very much.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
|
|
|
|
|
Is there a way in VB.NET 2005 to close all forms (or hide) except the one that is being loaded, without typing a load of code to hide each form?
Cheers
|
|
|
|
|
I don't remember off the top of my head, but I think you can loop through all of the Form objects and hide all but the one you want to keep open. Hope this starts you off on the right foot...
|
|
|
|
|
The Application object has a property that lists all open forms, you can iterate over that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
What do you mean, application.exit.... something??? Im not a wiz at vb by the way, just a beginner!
|
|
|
|
|
harveyhanson wrote: Im not a wiz at vb by the way, just a beginner!
This makes me question what you're really trying to do with this.
The Application object has a collection called OpenForms . All you need to do is iterate over this collection and call Hide on each form, taking care not to hide the form you want to show.
For Each f As Form in Application.OpenForms
' Make sure we're not hiding the form this code is on...
If f Is Not Me Then
f.Hide
Next
Next
|
|
|
|
|
The aim is to make a goodbye screen, but at the mo it is just over the top of the current form, whereas i want that to be the only form shown!
I will have a go with this statement
|
|
|
|
|
Then that's what you do. After that, you can wait a little bit, then call Application.Exit.
|
|
|
|
|
Dave Kreskowiak wrote: For Each f As Form in Application.OpenForms
' Make sure we're not hiding the form this code is on...
If f Is Not Me Then
f.Hide
Next
Next
That was what I was thinking of yesterday when I replied in the earlier post...
|
|
|
|
|
is this the exact code i should use?
I have tried it and i get how it works, but i am getting an error on "not me" bit, and why is there 2 nexts, wouldnt one just create the loop?!
|
|
|
|
|
That first Next should be an "End If" actually.
You should NEVER just copy and paste code. Try and understand any examples and write your own. There's too many "Copy'n'Paste" programmers out there clogging up the forums.
|
|
|
|
|
Dont worry, i am just trying out code really, not copying and pasting and leaving it that way.
Still, what is the "not me" bit about?
|
|
|
|
|
Me always referes to the current instance of an object. Since every open form ends up in the OpenForms collection, that loop has to check to see if it's going to hide the form the code is running on.
|
|
|
|
|
hi there
i am writing an app which collects screen captures and the uses getpixel to read colors of various pixels on the captures... a problem i have run into though is that for this line:
curcolor = gamescreen.GetPixel(432 - (57 * x), 432 - (57 * y))
i am getting an error saying the object is currently in use elsewhere
... i'm not exactly sure what to do, but i've played around with a few things... curcolor and gamescreen are not being used anywhere else at the time, so i am assuming it has something to do with GUI... any suggestions would be appreciated, thanks!
|
|
|
|
|
Your best bet if you're doing a lot of screen reading is to read my image processing articles and write a C# dll that does it, because VB.NET can't do it the way C# can, which is faster.
Do you have more than one thread going on ? I suspect that getpixel locks the bits internally every time, and that they are still locked from the last call, hence the error.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
visual basic 6
When I use webbrowser control,
I can write
WebBrowser.Document.parentWindow.execScript "window.alert=null;"
on WebBrowser_NavigateComplete2 event
now i use vbMHWB control, how to do it ?
当我在vb中使用webBrowser这个控件的时候,我可以在WebBrowser_NavigateComplete2这个事件
中执行WebBrowser.Document.parentWindow.execScript "window.alert=null;"这个方法,
现在,我使用了vbMHWB这个控件的时候,我怎么使用Js的execScript方法重载js的一些方法,比如window.alert=null;window.focus=null;等等在WebBrowser_NavigateComplete2这个事件中现在好像不支持,一运行会报error.怎么解决?
hi
|
|
|
|
|
![Go to Parent](https://www.codeproject.com/App_Themes/CodeProject/Img/arrow-up24.png)
<br />
<br />
Private Sub brwWebBrowser_DocumentCompleteWBEx(ByVal wbUID As Integer, URL As Variant, ByVal pDisp As Object, ByVal isTopLevel As Boolean, ByVal sDocSource As String) <br />
<br />
'IE中DHTML的属性和方法可以重写。当然alert,confirm, showModalDialog也不例外。<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.alert=null;" '<------error here! access refuse 访问拒绝 <br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.confirm=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.showModalDialog=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.showModelessDialog=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.open=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.focus=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.onunload=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.attachEvent=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "window.eval=null;"<br />
brwWebBrowser.Document(iCur).parentWindow.execScript "eval=null;"
hi
|
|
|
|
|
does some man get the code for NavigateError?
when website address error was wrong, there will be link to fixed webpage,,,
regards
henry
henry
|
|
|
|
|
What is it that you want ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
the code is for that , when user input a wrong website address and which address is unavailable or does not exist, the IE will be linked to a fixed website.
not sure it is clean or not, looking for your help,,,
regards
henry
|
|
|
|
|
So, all you should have to do in your NavigateError event handler is call Navigate to a known good page, like a local file or some other site.
|
|
|
|
|
Hi,
How to show a Crystal report without Database using VB6.
Thanks & Regards
Kumaran
|
|
|
|
|
Kumaran21cen wrote: How to show a Crystal report without Database using VB6.
After a quick google search, I don't think it is possible...
|
|
|
|
|
The only thing that's "very urgent" in a forum environment like CP, is the need to pee.
AFAIK, CrystalReports will only work in a database environment.
|
|
|
|