|
If you include that Bitmap in the project directory, you can then include it in your project and select Build Action to embedded resource in the properties window.
To retrieve the embedded bitmap you would use the overloaded constructor Bitmap(Type type, string resource), where the parameters type would be ME.GetType() and resource would be "myBitmap.bmp".
If you choose the Build Action as content, it will be installed in your program's directory in the user's computer and you can use a relative path to it: Bitmap(string path) where path is just the full name (myBitmap.bmp).
As to the wave file, it can also be embeded if you include it in the project and set the build action to embeded. Then to retrieve it, the only option I see is to retrieve it as a raw stream (using the GetManifestResourceStream, for instance), but maybe there some other way to retrieve it that I am not aware of.
|
|
|
|
|
Thanks A lot! The application.StartupPath namespace worked like a charm!
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
Hello everybody...
i need help in running applications other than exe files using visual basic 6.0 i.e. if i want to open a .doc document using visual basic depending on the user chosen from the open dialog box not statically
shell("c:\program files\office\word.exe c:\mydoc.doc") this opens always the same document..
this is not what i need. i want the user to browse his computer for certain files extensions on his harddrive and when he chooses the file it opens.
P.S. the program must work for only one extension...
thank you very much
adnan madi
|
|
|
|
|
in vb6 :
Add the Microsoft Common Dialog Control to the components
then add the control to the form
CommonDialog1.Filter = "Doc|*.doc"<br />
CommonDialog1.ShowOpen<br />
<br />
shell c:\program files\office\word.exe" & CommonDialog1.FileName
you better also check if the user click cancel by checking the length of CommonDialog1.FileName
|
|
|
|
|
Hi
I'm trying to access a sequence which is part of a node in an XML file.
<br />
<property pr_ref="ABC" ... ><br />
<sellingpoint text="HALLWAY" /><br />
<sellingpoint text="DINING ROOM" /><br />
<sellingpoint text="KITCHEN" /><br />
</property><br />
I can iterate through the "property" nodes and retrieve their columns (pr_ref) but how on earth do I access the sequence of selling points? I've tried childrows and parents rows and I'm lost!
I'm using VB.NET and I have the entire file in a DataSet. The second table of the dataset seems to contain ALL of the sellingpoint rows, not just those related to the one property.
I'm desperate!
Bernhard
Don't worry, nobody lives forever.
|
|
|
|
|
The DataSet will load the different levels of nodes into seperate tables, but will create relationships between those tables for you. The property table that is created in the DataSet should have a relationship to the sellingpoint table, which could be accessed through the DataSet.Tables(0).ChildRelations collection. Using this DataRelation, you can access the sellingpoint children of a property row by doing DataSet.Tables(0).Rows(0).GetChildRows(DataRelation).
There are other ways to do this as well. Just take a look at the help for DataSet and DataTable for more information. Or, to get an idea of exactly what is in your DataSet after loading the XML, set a breakpoint in your code, and do a QuickWatch (right click on an object after breaking into code during debug of your application) of your DataSet.
|
|
|
|
|
Hi,
I hv an application that need user to key in value for 2 text box. After that i will bind data to combo box based on the values of text boxes. However, i don't hv a button to trigger that binding process. I want to perform this process in combo box click event. But i hv to click the combo box twice. How to make user only click combo box once and then the value will directly pop out in combo box?
Private Sub cbSubconRoute_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cbSubconRoute.Click
If (txtN.Text = "" Or txtC.Text = "") Then
lblTxnStatus.Text = "Please Key In NSID And NSSPEC!"
Return
End If
If (cbSubconRoute.Items.Count < 1) Then
bindDataForComboBox()
End If
End Sub
Private Sub bindDataForComboBox()
cbSubconRoute.Items.Add("")
cbSubconRoute.Items.Add(txtN.Text)
cbSubconRoute.Items.Add(txtC.Text)
cbSubconRoute.Refresh()
End Sub
|
|
|
|
|
I don't think you're not going to be able to do it that way. Why not add an event to the text boxes that checks if they both have text in and populate the combo box then? or maybe populate the text box on the Mouse_over event of the combo box?
Beware the chickens, for in their silence, they plot...
Life is too short to be taken seriously.
-- Oscar Wilde
|
|
|
|
|
Hi,
I have trouble in executing shell commands within windows service. Below is my code in Timers Elapsed event. Timers interval is 5 sec. Other than this code everything else is working. I am not sure why I am unable to execute this code. I am running my windows service as a User, which has administrator rights. I also tried to run this windows service as LocalSystem but nothing happens.
Have a nice day.
Naqsh
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
Dim proc As System.Diagnostics.Process = New System.Diagnostics.Process()
proc.StartInfo.FileName = "cmd.exe"
proc.StartInfo.Arguments = "/C net start ""IIS Admin"""
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
proc.StartInfo.CreateNoWindow = True
proc.Start()
End Sub
Justice and Peace for everyone.
|
|
|
|
|
That's because (I THINK!!) CMD will only launch on Desktop 0, what the user sees. You can't launch CMD from a service because the service has no visible desktop and has no access to interactive inputs (keyboard and mouse), which CMD requires.
What you should be doing is using the ServiceController class to start the IIS Admin Service. This is done something like this:
<br />
Dim myController As New System.ServiceProcess.ServiceController("IISAdmin")<br />
If myController.Status.Equals(ServiceControllerStatus.Stopped) Then<br />
myController.Start()<br />
End If<br />
RageInTheMachine9532
|
|
|
|
|
how can I print html code as it looks in internet exploer using VB
for example.. the text has following html code
<br />
< html ><br />
<body><br />
< b >hello! how are you !!! < /b ><br />
</body><br />
< /html ><br />
vb supposes to print
hello! how are you !!! in bold.
|
|
|
|
|
Do you mean displaying a web page in a VB program? You can use the Web Browser control on your form to do that.
--
Ian Darling
|
|
|
|
|
I want to print it.. I dont' know what to use..
all the given html code should be printed as we see on the web browser.
|
|
|
|
|
There is a artical in .Net Journal about a spider crawler
that has a parser library in the download. I am sure it's
not as good as IE but it is managed and no COM.
Bo Hunter
|
|
|
|
|
Hi,
If you are using MS Internet controls a.ka Web Browser control then you could use.
In the plethora of constants, the following can be found as a member of SHDocVwCtl.OLECMDID to be used as a parameter to ExecWB...
Const OLECMDID_PRINT = 6
Const OLECMDID_PRINT2 = 49 (&H31)
Const OLECMDID_PRINTPREVIEW = 7
Const OLECMDID_PRINTPREVIEW2 = 50 (&H32)
The Browser control exposes ExecWB which is simply an OLE execution/action method.
for example...
objBrowser.ExecWB OLECMDID_PRINT
Hope this helps.
Regards
Benkku
|
|
|
|
|
The CmdExecOption parameter is not optional so use...
objBrowser.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
Regards
Benkku
|
|
|
|
|
thank you very much..
I got it
|
|
|
|
|
can someone help exporting from .Net to Visual Basic 6.0??
I'm new to Visual Basic so i created a visual basic code in .net
Imports System.Web.Mail.MailMessage
'Imports CDO
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents buttonSend As System.Windows.Forms.Button
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.buttonSend = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'buttonSend
'
Me.buttonSend.Location = New System.Drawing.Point(104, 88)
Me.buttonSend.Name = "buttonSend"
Me.buttonSend.TabIndex = 0
Me.buttonSend.Text = "Button1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.buttonSend})
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
'These 3 were added while I was debugging the problem, but they don't seem to help
Dim MailMsg As System.Web.Mail.MailMessage
Dim MailSrvr As System.Web.Mail.SmtpMail
Private Function mail()
MailMsg = New System.Web.Mail.MailMessage()
MailMsg.From = "from@email"
MailMsg.Body = "Test Message!"
MailMsg.Subject = "HI"
MailMsg.To = "person@test.com"
Try
MailSrvr.SmtpServer = "server.com"
MailSrvr.Send(MailMsg)
MsgBox("erfolgreich")
Catch err As Exception
Debug.WriteLine(err.Message)
End Try
End Function
Private Sub buttonSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonSend.Click
mail()
End Sub
End Class
i can't use this code in vb 6.0 like this.
can someone help me find a way to export this code?
Thanx
|
|
|
|
|
You want to convert from .NET BACK to VB 6.0? ! E-Gad man why? As far as I remember VB 6's E-Mailing system was quite different to .NET's. .NET deals with objects and VB 6.0 well... didn't quite do it that way.
I'm not quite sure if it's going to be possible using your current code... But I may be wrong.
Beware the chickens, for in their silence, they plot...
Life is too short to be taken seriously.
-- Oscar Wilde
|
|
|
|
|
Your right, It isn't possible using the code supplied. I don't think vb6 has any mail capability built in for smtp. You will have to use the windows api and roll your own. You can use the outlook framework from vb6, but then you make your code rely on the fact that outlook must be installed.
|
|
|
|
|
thank you for your help,the reason why i want it in vb6.0 is
because vb 6.0 is installed on every workstation so everyone can use the code
.net not
What about VBA? is it possible to send Smtp mail?
Thanx
|
|
|
|
|
I know almost 0 about vba, but I believe it is just a subset of vb6? So I would guess that you would have the same problems. If you have vba though that means you have some of office installed on the users cpu. If you have outlook that might work for you.
|
|
|
|
|
i know,why make it difficult, with outlook is it quite easier
but i don't wanna use outlook.I got it in vb6,hope i can use the code
in vba,but im gonna finish work today I'll try it tomorrow
so anyway thank u
Thanx
|
|
|
|
|
can someone help me sending a email in vb via smtp?
Thanx
|
|
|
|
|
problem solved
Thanx
|
|
|
|