|
To change Background color of MdI form
Do not set isMDIcontainer property of the MDI form to true. Add the following code.
Private Sub test_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mdiClient1 As MdiClient = New System.Windows.Forms.MdiClient
mdiClient1.Dock = System.Windows.Forms.DockStyle.Fill
mdiClient1.Name = "mdiClient1"
mdiClient1.BackColor = Color.DarkCyan
Me.Controls.AddRange(New System.Windows.Forms.Control() {mdiClient1})
Me.IsMdiContainer = True
Dim frm As Form1 = New Form1
frm.MdiParent = Me
frm.Show()
End Sub
this should work for mdi form.
How to change the background color of a toolbar:
1.Place a panel on your form
2.Set the panel's docked property to Top (the default for a toolbar)
3.Set the panels backcolor to the color that you want the toolbar to be
4.Place a toolbar on the panel mentioned above
The Toolbar & its buttons inherit their backcolor from their parent control. Seems simple enough.
You could always 'subclass the toolbar and do the drawing yourself' but for a newbie to VB simple is best.
|
|
|
|
|
hi,
plz help me...how to send email using VB6.0
is possible send me the link or code for that
bye
Paritosh
|
|
|
|
|
Dear
MAPI control may fulfill your requirements.
Thanks
Mahbub8957
|
|
|
|
|
Thanks but
do u have any sample program or link
bye
Paritosh
|
|
|
|
|
sample program is avaiable in MSDN. Just make a search indicating MAPI control.
Mahbub8957
|
|
|
|
|
my machine doesnot have MSDN.
If you have any sample or link then jusd otherwise no probs.
Paritosh
|
|
|
|
|
paritosha wrote: my machine doesnot have MSDN.
But the internet does!
http://msdn.microsoft.com
|
|
|
|
|
I hope i will be usefull
it is a my old program
http://www.fulminegiallo.it/AnoniMail.zip
|
|
|
|
|
http://lab.msdn.microsoft.com/searchbeta/Default.aspx?query=MAPI+Control
Mahbub8957
|
|
|
|
|
|
I am very new to VB.Net programming.
I am uploading data from one branch office to another
through modem connections of telephone line.
As i am using the MSComm Control And Also NetCommOcx
ActiveX Controls,but as when it is comming to
any one of the properties of the either control,
it is throwing an exception as
An unhandled exception of type 'InvalidActiveXStateException' occurred in
axinterop.NetCommOcx.dll
I hav searched at internet but of no use.
since i hav imported System.Runtime.InteropServices
there is no use.
kindly give a sol to the problem.
I am sending the Module where the properties of the control is used
Imports System.Object
Imports NETCommOCX.NETCommClass
Imports IClean.Mdl_MSCommVariables
Imports System.Runtime.InteropServices
Imports System.Windows.Forms.AxHost
Public Class MdlCl_MSComm
Public WithEvents MsComm1 As New AxNETCommOCX.AxNETComm
Public Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Dim Modem_Present As Boolean
Public Sub init()
Try
MsComm1.RThreshold = 1
MsComm1.SThreshold = 1
MsComm1.InputLen = 0
MsComm1.CommPort = 1
MsComm1.PortOpen = True
Call Clear_Buffer()
MsComm1.set_Output("ATV1Q0" & Chr(13)) 'Send Attention To the Modem.
'MsComm1.Output = "ATDT" & "055782588" & Chr(13) 'AT tells the modem that a command is coming up.DT tells it to dial the upcoming number using Tone dial.
MsComm1.Handshaking = NETCommOCX.HandshakeConstants.comRTS 'Able to connect and send data but not receive data.
MsComm1.set_Settings("9600,N,8,1")
'AddHandler MsComm1.OnComm, AddressOf MsComm1_OnComm
Catch ex As System.Runtime.InteropServices.COMException
MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
End Try
End Sub
Public Sub Dial()
Try
MsComm1.set_Output("ATDT" & "055782588" & Chr(13)) 'AT tells the modem that a command is coming up.DT tells it to dial the upcoming number using Tone dial.
Sleep(600)
' Ask the user to wait until the phone rings.
'MessageBox.Show("When you hear a busy signal, click OK." & vbCrLf & "When you hear a ringing signal, pick up the receiver and click OK.", vbInformation Or vbOKOnly, "Please Wait")
MessageBox.Show("When you hear a busy signal, click OK.", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
Catch ex As System.Runtime.InteropServices.COMException
MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
End Try
End Sub
Public Sub Clear_Buffer()
MsComm1.OutBufferCount = 0 'Returns the number of characters waiting in the transmit buffer.
MsComm1.InBufferCount = 0 'Returns the number of characters waiting in the receive buffer.
End Sub
Public Sub Phone_Number(ByVal num As Integer)
Try
MsComm1.set_Output(num)
Sleep(800)
Catch ex As Exception
MessageBox.Show(ex.ToString, "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
End Try
End Sub
Public Sub Data_Transmit_Terminate()
MsComm1.RTSEnable = False 'Disable The "Request To Send" Line.
End Sub
Public Sub Data_Recieve_Terminate()
MsComm1.DTREnable = False 'Disable The "Data Terminal Ready" Line.
End Sub
Public Sub Terminate_Connection() 'Connection is Closed.
MsComm1.PortOpen = False
MsComm1.RTSEnable = False
MsComm1.DTREnable = False
End Sub
Public Sub Modem_Connect()
End Sub
Public Sub Send_Data(ByVal dat As String)
MsComm1.set_Output(dat)
Sleep(500)
End Sub
'Returns the most recent communication event or error.
Private Sub MsComm1_OnComm(ByVal sender As Object, ByVal e As System.EventArgs) Handles MsComm1.OnComm
'Modem_Input = MsComm1.Input
Select Case MsComm1.CommEvent
Case NETCommOCX.NETCommConstants.NETComm_EV_SEND
status = "Sending . . . "
Exit Select
Case NETCommOCX.NETCommConstants.NETComm_ER_BREAK
Case NETCommOCX.NETCommConstants.NETComm_EV_RING
status = "Ringing . . . "
Exit Select
Case NETCommOCX.NETCommConstants.NETComm_ER_RXPARITY
Case NETCommOCX.NETCommConstants.NETComm_ER_RXOVER
Case NETCommOCX.NETCommConstants.NETComm_EV_EOF
End Select
'If MsComm1.CommEvent = 6 Then
' status = "Ring . . . "
'ElseIf MsComm1.CommEvent = 1 Then
' status = "Transfer Data . . . "
'End If
'If MsComm1.CommEvent = 1001 Then
' MessageBox.Show("Break Signal Is Recieved.", "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
'ElseIf MsComm1.CommEvent = 1004 Then
' MessageBox.Show("Framing Error.", "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
'ElseIf MsComm1.CommEvent = 1009 Then
' MessageBox.Show("Parity Error.", "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
'ElseIf MsComm1.CommEvent = 1010 Then
' MessageBox.Show("Transmit Buffer Full.", "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
'ElseIf MsComm1.CommEvent = 1011 Then
' MessageBox.Show("Unexpected Error.", "Modem Details", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly)
'End If
End Sub
End Class
neelima
|
|
|
|
|
Hello everyone,I'm still migrating the VB to VB.NET Engine here.I am a beginner to VB.NET. I found this error message while I'm coding,can anyone give me a help please?
Overload resolution failed because no accessible 'New' can be called without a narrowing conversion: 'Public Sub New(selectCommandText As String, selectConnection As System.Data.SqlClient.SqlConnection)': Argument matching parameter 'selectConnection' narrows from 'System.Object' to 'System.Data.SqlClient.SqlConnection'. 'Public Sub New(selectCommandText As String, selectConnectionString As String)': Argument matching parameter 'selectConnectionString' narrows from 'System.Object' to 'String'.
And the following is my code>>
Private Sub Spam_Now()
Dim MemberDV As DataView
Dim i As Integer
Dim sql1, sql2, sql3 As String
'sql1 = "SELECT TOP 20 * FROM TT_Member WHERE Reminder = '0' AND Status = '1'"
ObAdapter1 = New SqlDataAdapter("SELECT TOP 20 * FROM TT_Mber WHERE Reminder = '0' AND Status = '1'", Obconn1) '<
|
|
|
|
|
drexler_kk wrote: Argument matching parameter 'selectConnectionString' narrows from 'System.Object' to 'String'.
You are passing a String parameter for an SQLConnection object. The argument you are passing must be an SQLConnection object and not String object.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Thanks for your solution. Do you mean that I should change that line to the following?
ObAdapter1 = New SqlDataAdapter(Obconn1, "SELECT TOP 20 * FROM TT_Member WHERE Reminder = '0' AND Status = '1'")
ds1 = New DataSet
ObAdapter1.Fill(ds1, "MemberList")
I have try but it works,so I just want to reconfirm that is what you ask me to modified?
Thank you so much for the solution and effort.
Regards
Drexler
|
|
|
|
|
|
Yeah,thank you so much. I really learn from your advice. Good solution.
Regards
Drexler
|
|
|
|
|
hi,
i try to send an email with attachment, but when the program fails to send out the mail, i can't delete the file (the file i wish to attach in the mail) in my local drive, i think it is locked when i am trying to send, i have used the code below to delete the file
For Each sSubstr In attach_string.Split(delim)<br />
If System.IO.File.Exists(sSubstr) = True Then<br />
Try<br />
System.IO.File.Delete(sSubstr)<br />
'MsgBox("File Deleted")<br />
Catch ex As IOException<br />
Label1.Text = ex.Message<br />
Finally<br />
End Try<br />
End If<br />
Next
i didn't catch any exception while debuging but it fails to delete the file, when i go to the path (where i the file is) to delete the file manually, windows tells me "Canot delete File: Access is Denied. Make sure the file is not ful or write protected or currently in use". Any idea how to fix that?
-- modified at 23:23 Sunday 22nd January, 2006
|
|
|
|
|
|
thanks for your fast reply,
can i know how to close the open handles file, after i fail to attach a mail when executing
SmtpMail.Send(Message)
For example i am trying to do:
try<br />
SmtpMail.Send(Message)<br />
catch ex as exception<br />
' what should i do here to close the open handles file when i fail to attach?<br />
' then i fail to delete the attachment here<br />
finally<br />
end catch
Thanks
|
|
|
|
|
|
i have called the close method for file steam at the other place of my program but it still din work and the System.Web.Mail.SmtpMail does not have a close method,can u show me a simple piece of code on wht to write in the catch block when i fail to send the email?
<br />
try<br />
If attach_string <> "" Then<br />
For Each sSubstr In attach_string.Split(delim)<br />
Dim myAttachment As MailAttachment = New MailAttachment(sSubstr)<br />
Message.Attachments.Add(myAttachment)<br />
Next<br />
End If<br />
<br />
SmtpMail.Send(Message)<br />
catch ex as exception<br />
' what should i do here to close the open handles file when i fail to attach?<br />
finally<br />
end catch
|
|
|
|
|
Try Disposing the SmtpMail object before you try to delete the file. There is no other method to "force" the filehandle to be released.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
can you show me on how to dispose off the smtpmail object? because i couldn't find any dispose method or close there, thanks alot!
|
|
|
|
|
I'm sorry, it should have been the Message object, not the SmtpMail object.
Message.Dispose()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I guess this one maybe a bit tough, but, does anyone know how to create a virtual com port? Or have any idea on how this can be done?
The aim is to create 2 ports with a virtual connection between them so that I can send data out one port for testing a program that recieves data from the other.
Thanks..
|
|
|
|
|