|
B Journey wrote: The most practical way should be the set the caller form as parent form and then in 2nd form redirect user to parent form.
That's exactly what I did in the first example. Form2 excepts a caller, 'the parent', so it knows who to talk to. The thing that seems to bother you is the 4 lines of code it takes to do that. Sorry, I just don't consider that a "bunch of coding". It's a pretty simple straighforward solution. Not to mention the fact that you could actually create your own extended form class with this code in it. Then whenver you need a form like this you would inherit from this class. You would have no need to write that code ever again
Also there is another way. There always seems to be another way, huh. The show method is overloaded and excepts an 'owner' form. You could pass your forms instance when you call the show method. Every form has an 'Owner' property. You could then access the caller through this property from form2. One thing to note about an owned form is that it will minimize whenever the owner minimizes and restore whenver it's restored. This may be desired, and in your case it doesn't even matter because the owner would be hidden and couldn't be minimized. So for example
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New Form2
frm.Show(Me)
End Sub
Form2 could then use the code Me.Owner.Show to show it's parent.
B Journey wrote: This cannot be applied for forms because a form instance can be triggered from different procedures at same time. Therefore, sticking with creation time is not appropriate. Think about two timer components. Each timer shows the same form in every second because the each timer works independently.
I'm not sure why you think this (the code I posted last time) can't be applied to forms. It most definitly can, and does work just fine. The reason I showed the creation time was to clearly demonstate the same instance of the form was being shown whenver you called Form1.show or Form2.show. The point of the code was to demonstrate that in vb.net there is already a built in way to show a form without having to worry about creating a new instance or tracking the old instance. Form2.Show will create a new instance for you if one doesn't already exist, and if it does that same instance will be shown (sound familiar). It should because that's exactly what I did in the original post I made. Now if you meant it wasn't appropriate because you thought each timer needed to show a different instance of the other form then yes of course that code woulnd't be appropriate. As I've stated from the begining different situation call for different solutions.
-- modified at 15:44 Tuesday 27th February, 2007
|
|
|
|
|
what is 192 bit encryption and how we encorporate in our programming
namita
|
|
|
|
|
192 bit encryption is an encryption that uses a key with a size of 192 bits.
Look in the System.Security.Cryptography namespace for encryption classes.
---
single minded; short sighted; long gone;
|
|
|
|
|
Sir/Madam,
I wanted to implement the events and delegates in my program.Can somebody please provide a code link
Thanks and regards
Pankaj
|
|
|
|
|
In some cases you may want to declare an event to use an existing delegate type as its underlying delegate. The following syntax demonstrates how:
Delegate Sub MyDelegateType()
Event MyEvent As MyDelegateType
Here is the link:
http://www.codeproject.com/vb/net/Delegate.asp[^]
What a curious mind needs to discover or penetrate a knowledge is noting else than a pin-hole.
|
|
|
|
|
Sir/Madam
I wanted to do code in the application event file .Can somebody please provide help.
Thanks and regards
Pankaj
|
|
|
|
|
An application has more than one evets such as StartupNextInstance, ThreadException,ApplicationExit and etc...
Try to be specific which application event you want to use. I strongly suggest you to examine MSDN about Application events.
What a curious mind needs to discover or penetrate a knowledge is noting else than a pin-hole.
|
|
|
|
|
Sir/Madam,
I wanted to know something about ApplicationExit ,ThreadException,StartupNextInstance
Please help
Thanks and regards
Pankaj
|
|
|
|
|
There are many events related to application. That is why you should browser application events under MSDN to examine each of them.
Application.Exit ()
Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed.
Application.ThreadException
Occurs when an untrapped thread exception is thrown.
please apply to MSDN for others
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Sir/Madam
There are two terms in Authenticatin mode for desktop application namely
Windows<br />
Aplication defined
Can i get to know the basic difference between them.By default the application provides Window Authentication mode.
Thanks and Redards
Pankaj
|
|
|
|
|
Sir/Madam
I wanted to know the basic difference between option explicit and option strict.I meant that how should i use these terms in my coding
Thanks and Regards
Pankaj
|
|
|
|
|
OPTION EXPILICIT Forces explicit declaration of all variables in a file.
Option Explicit { On | Off }
OPTION STRICT Restricts implicit data type conversions to only widening conversions.
Option Strict { On | Off }
Define these statements on top of the page.
What a curious mind needs to discover or penetrate a knowledge is noting else than a pin-hole.
|
|
|
|
|
Sir/Madam,
If u please explain with the help of an example.
Thanks and Regards
Pankaj
|
|
|
|
|
' FOR OPTION EXPLICIT ON
Dim thisVar As Integer
thisVar = 10
' The following assignment produces a COMPILER ERROR because
' the variable is not declared and Option Explicit is On.
thisInt = 10 ' causes ERROR
'FOR OPTION STRICT
Dim thisVar As Integer
Dim thisObj As Object = New widget
thisVar = 1000 ' Declared variable does not generate error.
' Attempting to convert Double to Integer generates a COMPILER ERROR.
thisVar = 1234567890.9876542 ' causes ERROR
' Late-bound call generates a COMPILER ERROR.
Call thisObj.Method1() ' causes ERROR
Please admit to MSDN..
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Sir/Madam,
I was trying a compression program in vb.net.I did it well in C++.But it is not getting possible in vb.net.Can somebody please send the code project link that illustrate the utility of single and double link list
in vb.net
Thanks and regards
Pankaj
|
|
|
|
|
Hi there, I am new to VB.NET and I would like to create a data grid on a form, which allows me to add data, and save to a database.
The fields on the Grid will be text box, Combo box, and another to allow the user to browse to find a file location.
I have been unable to successfully create this, and I also am unable to find any decent tutorials. Can anyone help please?!
Your help is appreciated,
Maz
|
|
|
|
|
Hi there,
I Need to embed virus checking into my appliction.
If any1 has any clue / info on this topic please let me know
Thank you!
M. Nauman Yousuf
|
|
|
|
|
Virus checking is a big deal. Companies make their entire business on doing it well. It's doubtful that you can add it to your app as an afterthought. To compete, you need to dedicate many man years of development.
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 )
|
|
|
|
|
Hi Christian,
I think he meant to call a default antivirus software, already installed on the PC, through his program. I think, this should be easily possible. But even i dont know how to do it ? Can you please guide in this respect, if you have some knowledge about it ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Thank you! Graus,
But I have heard that products like Symantec Nortan and Macfee provide interfacs for checking files for virus.
Any update in this please let me know
Thank you!
M. Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
OK, that's not what I thought you said. In that case, I guess your best bet is to check their sites to see which ones offer such an interface, and then buy the one you decide to work with. I have no idea, I've never done 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 )
|
|
|
|
|
Hi,
I have sucesfully added a button in Microsoft Office Appliction as add-ins.
I am yet unable to get the file path of active document.
If any1 has any info on this please let me know.
Thank you!
|
|
|
|
|
I,m Into a project were as im needing to build A proprietary web browser, as i have various code on my webserver, that only allows this Browser to Access the Information, now im guessing there are several ways to accomplish this possibly w/ Cookies, and Sessions perhapes, i'd like to discuss my idea here and have u guys tell me if im heading into the Correct Direction,
what im really needing is a browser that Doesn't use the IE web control OCX so when my web servers Browser detection PHP Code see's it not as IE / Opera / Mozilla / NS / or any other flavor it lets it gain Access, otherwise it Blocks it with my 404 page, can anyone Give me more insite to my idea's thanks alot
|
|
|
|
|
Sounds like you need to write an entire web browser. This is a major task, especially if expect to support CSS and Javascript. Good luck.
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 )
|
|
|
|
|
I've already written 2 web browsers but using the Microsoft web browser control, i wanna create my own web browser control
|
|
|
|