|
How do I open an URL using .NET? In Visual Basic 6 I used the ShellExecute API call. I defined the constant variables in a module file like this:
' Constant variables for the ShellExecute API
Public Const SW_SHOWNORMAL = 1
Public Const SW_SHOWMINIMIZED = 2
Public Const SW_SHOWMAXIMIZED = 3
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Public Const SW_SHOWMINNOACTIVE = 7
Public Const SW_SHOWNA = 8
Public Const SW_RESTORE = 9
Public Const SW_SHOWDEFAULT = 10
If this is the API to be used in .NET, where do I declare these constant variables? If there is another way of doing it, please let me know.
Thanks
Brendan
|
|
|
|
|
In the future, search the forums first. You answer has been covered so many times, it's silly. For instance, the same question was posted about 8 down from yours.
You need to use the Process class and just launch the URL. This will launch the default web browser with the URL you give it.
Process.Start("http://myurl.somehwere.com")
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need help with regards to my frmSplash form. Not sure where to load it. I want it to display while the application loads. Where do I put the call to the frmSplash form? And how does a person determine how long an application loads? The name of my main/startup form is frmMain. Will this differ between VB.net and C#.net? I went through some Visual Basic 6 code and they did it in a module file like this:
Sub Main()
frmSplash.Show
End Sub
Thanks
Brendan
|
|
|
|
|
Why dont you put the form in a ascx file, set it in a Sub Control_load function.
file.ascx
<%@ Control Language="VB" Src="file.vb" Inherits="Classname">
<td
<asp:textbox="" id="Namefield" runat="server"> |
file.vb
Public Sub Control_Load(ByVal Sender As Object, ByVal E As EventArgs)
'The code in here will execute when loading a ascx file
End Sub
file.aspx
<%@ Register TagPrefix="UsrCtrl" TagName="FormSplash" Src="file.ascx" %>
'Point to it from your aspx code.
<usrctrl:formsplash id="Form" runat="server">
etc, etc
|
|
|
|
|
It's not a website, but an application.
|
|
|
|
|
declare your splash form as a class variable i.e.
dim splashForm as new splashFrm = null
then in the forms constructor show the form i.e
splashfrm = new splashFrm
spashFrm.show
application.doEvents 'this is to force the application to show the splash immediately
then you can continue processing in the constructor. Then in the forms load event do something like
if splashFrm <> null then
splashFrm.dispose
end if
sometimes the processing is too quick to actually see the splash form - in this case before you dispose of the splash form do something like - System.Threading.thread.sleep(3000)
|
|
|
|
|
I have a form called frmAbout which displays basic information about the application. When someone clicks on the About Us menu, this form is displayed. I display it as follows:
The code executes in the menu’s mnuHelpAbout_Click event handler.
' Load the about form
Dim aboutForm As New frmAbout()
aboutForm.ShowDialog()
On the about form is a button which allows the user to close the window. The code in the event handler cmdClose_Click is:
' Close form and release from memory
Me.Close()
I need to know, when I use the Form.close() method, does this mean the reference to this form is destroyed and no longer exists? Is there a better way of doing this? I also read that there is a Dispose method. When is this used?
Thanks
Brendan
|
|
|
|
|
Brendan Vogt wrote:
I need to know, when I use the Form.close() method, does this mean the reference to this form is destroyed and no longer exists?
No, it doesn't. You actually don't have to put any .Close() statement in the Closing event of the form. The form is already closing when this event fires.
But, when you use .ShowDialog() , you have to explicitly .Dispose() of the form when your done. If you don't, you will cause a resource leak in your application. Form 's use resources outside the managed framework which must be explicitly .Dispose() ed of.
'Load the about form
Dim aboutForm As New frmAbout()
aboutForm.ShowDialog()
aboutForm.Dispose()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have two separate programs that worked just fine one is in VB6 the other is in VB.Net. I get error when I tried to upgrade VB6 to VB.Net. ( Got an error message about MSCOMMX etc...) The first program is in VB6, reads in the barcode scanner data great. (source code can be found at www.freevbcode.com/ShowCode.asp?ID=2408)and the Second part of the code copy to the clipboard (VB.Net).
Public Class frmMain
Inherits System.Windows.Forms.Form
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
'This will add the text in the textbox to the clipboard. With
'the value set to false it will clear the clipboard of the data
'added by this program when the program exits.
Clipboard.SetDataObject(txtSource.Text, False)
End Sub
Private Sub btnPaste_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPaste.Click
'We want the data to be in a text format to add in our textbox
txtDest.Text = Clipboard.GetDataObject.GetData(DataFormats.Text, True)
End Sub
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub txtSource_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSource.TextChanged
End Sub
End Class
I want to compare the serial data that comes in from the first program to a list of other data. For example: if the serial data is YES, it will compare "YES", "NO", OR "MAYBE" will be the three choices. When yes is true, then it would print out a phrase, Ex: "You are correct". Then copy to the clipboard "You are correct"
So, my questions are is there a way I can convert VB6 to VB.Net, or VB.Net to Vb6. And is there a simple code to do the above compare function.
|
|
|
|
|
How can i change datagrid's column heading and how con i change null values to what ever i want.
|
|
|
|
|
I had problem opening SaveAs Dialog in Powerpoint.
and managed to solve this issue. However, I am
still trying to get the name file that I decided
to save from the dialog. Anyone has idea please
help.
Thanks in advance.
Shinya
With Application.FileDialog(ppFileDialogSave)
' Set file filter flags
Call .Extensions.Add("*.PPT", "PowerPoint Presentation")
Call .Extensions.Add("*.PPS", "PowerPoint Show")
.ActionButtonName = "Save"
.DefaultDirectoryRegKey = "Default"
.DialogTitle = "Save as"
.DirectoriesOnly = False
.InitialView = ppFileDialogViewPreview
.IsMultiSelect = False
.IsPrintEnabled = False
.IsReadOnlyEnabled = True
.OnAction = "ProcessSelection"
.UseODMADlgs = False
.Launch
End With
End Sub
|
|
|
|
|
Hi
I'm trying to read from MP3 Vedio File, I Found Many way to read the header but i need to read the Picture. Can any one help me to do that?
i'll be thankfull for you.
The_Debugger
|
|
|
|
|
Hi,
Does anyone know how to create in VB.net an application which acts similarly to Excel/Word 2003, whereby it is an MDI application, but the user has the choice between displaying the windows within the MDI interface or in the taskbar (which makes the app look like an SDI application). Currently Excel/Word allow the user to modify this setting in Tools>Options Windows in Taskbar checkbox.
thanks
tony
|
|
|
|
|
This type of funcitonality is not included in the Windows Forms classes. You'll have to write your own Forms class in order to get this to work. This would be such a large undertaking that you'll need to consider if the benefit will be worth the time investment.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm making my own RSS reader (I got bored) and right now I'm stuck at getting my application to run Internet Explorer with the link to the article. I don't want to hard-code the program to run. Instead, I want it to work like I double-clicked on a file: Windows will decided what program to use and how to make it work.
What function should I use? I'm writing this is VB.Net 2003.
Reedmon29
|
|
|
|
|
|
hi
i have wrote accountancy software and i want to put it in network of an organization.can i do this work in vb.net?
how i do it?
thanks
|
|
|
|
|
fatidarya wrote:
i have wrote accountancy software and i want to put it in network of an organization.can i do this work in vb.net?
You have to write an accounting application or are you deploying one? If you have to write one, of course you can use VB.NET for that. Deploying one with VB.NET? I'd look at other methods before trying to write something on your own. It doesn't sound like you have much network experience.
fatidarya wrote:
how i do it?
Your kidding, right?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks Dave
i am not kidding.i have wrote a billing program(system) for a tourism company.there is a local network in this company.and i want to deploy this program in that network.
do i use from socket programing?and what is essential hardware for this work?
please help me.
thanks.
|
|
|
|
|
If your deploying it, then you would use whatever tools are appropriate for the customers environment. If their running a Novell network, they might have ZENworks which will do the deployment to the workstation for you. If in a Windows network, SMS Server. You don't have to write anything in VB.NET to deploy this package.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, I'm not a hardcore programmer so I don't do programming very much. I do know how to program I just don't do it much so the problem is I am currently using VB 4.0 I only have this one project to do and so I don't want to spend a bunch of money to buy the latest version so here's my problem:
How do I get the computer to automatically resize pictures in a picturebox using VB 4.0? In VBA the picturebox has a property called "PictureSizeMode". You set that to Resize and the computer will resize the image to the size of the PictureBox at runtime but how do I do it in VB 4.0?
|
|
|
|
|
No idea here. You can't even find the docs on VB4 anymore. I started using VB5 back in 1997 and can't find the docs on that either.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am trying to open a textfile and manipulate it, then display the result in a textbox on Form1. At some point, I want to open Form2 and have the same data from the textbox on form1 displayed automtically in a textbox on form2. I have code written for everything except linking the two textboxes.
How do I do this??
|
|
|
|
|
quhaip88 wrote:
At some point, I want to open Form2 and have the same data from the textbox on form1 displayed automtically in a textbox on form2.
After you've created an instance of Form2 you can manipulate its child objects like you do with any other object. So just set the TextBox's Text property and then call Show(). Assuming that you want to do that somewhere in the Form1 class the simplest example looks like this:
Dim MySecondForm As Form2 = New Form2()
MySecondForm.TextBox1.Text = Me.TextBox1.Text
MySecondForm.Show()
Best regards
Dennis
|
|
|
|
|
Thanks, Dennis!. I was trying to make it too difficult...
|
|
|
|