|
If you will close your main form, the application will stop. You will have to hide the parent form each time. By the way, what kind of requirement is this ? Isn't it seem to be unsual ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
actually its not a requirement. i was practesing .my another doubt may sounds carzy.
is it not possible to trasnfer the main control from form to form so that i can close the parent window and continue to use the child window
|
|
|
|
|
The best way to do this, is to write your two forms as controls, and host them both on the one form.
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 am developing a database application in vb.net 2005 /ms access using ADO.Net using OLEDB. I have a couple of independent forms.In all the forms I have code that queries the data in the database.So, I have used the "Imports System.Data.Oledb " statement in all the forms.Is there any other way I can import the Oledb class so that it is imported once and stays active throughout the execution of the program and the methods of the ADO.net library are available from all the forms.Like we did in VB 6.0 using a module?
Also, I am using a couple of Dll import functions in my app using the DllImport statement.As for the Dlls also ,I have used the same DllImport statement in all the forms that calls the functions.Are there any performance issues associated with this kind of a design? Can we import the libraries once so that the functions are available anywhere from the program like the ADO library I mentioned above? If we do not import the Oledb library in all forms, it will result in a compilation error.Thanks in advance...
|
|
|
|
|
It sounds you like you really need to take a look at redesigning your app as n-tier. Use a UI layer for your forms, and a common data layer for all of your data access. You could probably benefit from putting a business logic layer between the two also.
You can read more on the concepts here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello everyone!
I have a question that I have been trying to solve and I can find a solution, if you know please share you wisdom!
I'm making a DLL that will be used by a ASPX page, this is not an ASP.NET application, just a DLL loaded by the page.
very simple, ControlLibrary code:
Namespace hello_world
Public Class cHello
Public ReadOnly Property sayhello() As String
Get
Return "hello"
End Get
End Property
End Class
End Namespace
page code:
<%@ Page Language="VB" Explicit="False" %>
<%@ import Namespace="hello_world" %>
Dim aHello As cHello
Sub Page_Load(Sender As Object, E As EventArgs)
aHello = New cHello()
End Sub
!!!!!<%=aHello.sayhello()%>!!!!!!!!!
Not much and it works, the only problem I can't debug it. when I put the break point on
Public ReadOnly Property sayhello() As String
nothing happens, I get my hello on the page but it does not stop...
as far as I could find it there use to be an option in studio 2003 called "Enable ASP.NET debugging" but I can't find in 2005.
Does anyone knows what I need to do? please help!
Thank you
ipokrov
|
|
|
|
|
I'm not expert in ASP.NET coding or debugging, but it would seem that you have to attach the Debugger to the ASPNET_WP process in order to make this work. You'll find the "Attach to Process..." menu item under the Debug menu.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Could someone help me with how to upload a text string to a web site file?
I tried this. Executes without errors but does not change the existing sh.htm file in any way.
thanks
Dim wc As New System.Net.NetworkCredential("xx", "yy")
web.Credentials() = wc
web.UploadString("http://www.xxx.com/sh.htm", "xxxx")
|
|
|
|
|
This is entirely dependant on IF the server will even let you do this. Most won't.
Check with your hosting service to see what the procedures are.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Interesting... is there an ftp alternative?
|
|
|
|
|
Again, that's a question that should be directed at your hosting company.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In VB.NET 2005:
is there any way to link the close button on the control box to another form rather than shutting the program, or is this close function set in stone???
Cheers
|
|
|
|
|
there is no built in link but you can create your own. in the closing event of the form1 cancel the close. then close form2 instead -- obviously requires that form1 has a pointer to form2.
|
|
|
|
|
Can you put an example of how this formclosing works, I have tried to declare it as a public class then put some code in, is this correct?
|
|
|
|
|
It's an event handler, just like Form Load, that gets called when the form is told to close. Docs on it are here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi!
How can I set a tooltip text for a specific control in run time?
Thank You!
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
It's simple:
ToolTip1.SetToolTip(Control, "Tool Tip Text")
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Thank you!
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi everybody,
I made an application which copy file's to a webfolder. Now I want to made a modification, that when I do a right mouse click on a file, or files or a directory in explorer, the user have the posibility to start the program and copy the file, files or entire folder to a webfolder (send to..). But how can I get the path/name of the selected file,files or folder?
For start I tried to figure out how I get the result of echo %cd% into a variable, but till now no success.
Thanks so far,
Jurgen
|
|
|
|
|
hi
I am working on small assignment which is about files,I want to save some information and I also want to read that information,And for future reference so user can search information, So i have tried with this code but it's not working well ,Well it is working but it's shows all information at one time if user click btnOpen but i dont want that
Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click<br />
Dim Response As DialogResult<br />
Dim NumberLine As Integer<br />
Try<br />
FileOpen(1, "c:\test.txt", OpenMode.Append, OpenAccess.Write)<br />
MyLine = (cboProcess.Text + txtWeight.Text + " " + DateTime.Now.ToString)<br />
PrintLine(1, MyLine)<br />
FileClose(1)<br />
MsgBox("File saved", MsgBoxStyle.Information)<br />
Catch IOExcept As IO.FileNotFoundException<br />
MessageBox.Show("file not found", "Default reset")<br />
Catch IoExcept As IO.DirectoryNotFoundException<br />
MessageBox.Show("directory not found ", "Default reset")<br />
Finally<br />
FileClose(1)<br />
End Try<br />
End Sub<br />
<br />
Private Sub btnOpen_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOpen.Click<br />
FileOpen(1, "c:\test.txt", OpenMode.Input, OpenAccess.Read)<br />
txtInk.Text = InputString(1, CInt(LOF(1)))<br />
FileClose(1)<br />
End Sub
I want to display search result line by line,And i also tried in btnAdd click event this code for line by line and open line by line ,But this code is not working at all
FileOpen(1, "c:\test.txt", OpenMode.Append)<br />
For I = 1 To NumberLine<br />
MyLine = cboProcess.Text + txtWeight.Text<br />
PrintLine(1, MyLine)<br />
Next I<br />
FileClose(1)<br />
and for btnOpen click event
FileOpen(1, "c:\test.txt", OpenMode.Input)<br />
Do Until EOF(1)<br />
MyLine = LineInput(1)<br />
Loop<br />
FileClose(1)
wating for help
|
|
|
|
|
If you want to show a line at a time, try reading the text using a method that returns a string array, then you can show the lines one at a time.
File.ReadAllLines returns a string[], I thought.
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 )
|
|
|
|
|
Hello
can anybody help me telling how to convert xy coordinate to the latitude and longitude.
could anybody give me the code or explaination for that.
|
|
|
|
|
|
u have given me so many links which link should i go. pls help me out otherwise i will loose my job.
help me iam confused
|
|
|
|
|
rahul1983 wrote: pls help me out otherwise i will loose my job.
Really? Do you think you are in the right job if you are so close to losing it?
So far you haven't provided enough information to answer your query. In order to translate from an XY grid to Lat/Long (i.e. coordinates on a sphere) you need to know what projection the grid is using. Once you know that you can work out how to translate between the two.
|
|
|
|