|
500 CONTROLS?!
I'd look at that and close the window immediately and the entire app shortly thereafter and write it off as being way to convoluted. How about breaking some of that up into multiple forms.
Coding for every one of these must be a real pain? Even to just get values!
RageInTheMachine9532
|
|
|
|
|
Hello,
I have three forms: frmCustomerTemplate, frmAddCustomer, and frmUpdateCustomer.
frmAddCustomer derives from frmCustomerTemplate, and frmUpdateCustomer derives from frmAddCustomer.
Diagram:
frmCustomerTemplate --> frmAddCustomer --> frmUpdateCustomer
I'm encoutering a problem where frmUpdateCustomer is not getting values from the fields that were defined on frmCustomerTemplate. For example, frmAddCustomer defines a Home Telephone textbox that was not declared on frmCustomerTemplate. When I do an update (using frmUpdateCustomer) I can only get the value from the Home Telephone textbox. All the other fields populate my variables with nulls, even though they are populated. All the controls on frmCustomerTemplate are declared as Protected.
Any ideas why this is happening?
Thanks,
Andrew
|
|
|
|
|
I have an application that calls a webservice and passes
a file to it to process the data. I currently have 1 file
format, and can process the data with no problems.
I would like to create a client that calls a webservice
dependant on the file name.
My question in short is this. Can you dynamically create
a reference to a webservice at runtime?
I assume I will need to modify the client to create a
proxy on the fly depending on file name but not sure if it
is possible.
Thanks in advance
=================================
When i was in school all I wanted was to get out into the real world.
Now that I'm in the real world all I want is to go back to school.
|
|
|
|
|
How do I make a mdiChild forms dock to a parent and auto hide to look like a tool bar (ex. VS.net property window)?
thanks,
Ryan
|
|
|
|
|
It depends how far you wany to go.
Take a look at the following article. It demonstrates how to popup a graphic. You should be able to adopt a similar technique with any form.
MSN Messenger-like popup
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
LearnVisualStudio.Net
|
|
|
|
|
I had the idea to copy the controls of a panel to a new Form. It works if I use the copyTo method of the control collection of the panel.
The problem is, the controls aren't copied, there moved!? Is this a bug or ...? Anyone an idea?
Test it yourself. On a simple Windows Form with a panel1, a button1 and a textbox1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' rise!
Dim form2 As New Form
Dim c(Panel1.Controls.Count - 1) As Control
Panel1.Controls.CopyTo(c, 0)
form2.Controls.AddRange(c)
form2.Size = Panel1.Size
form2.Show()
End Sub
As you will see, the controls are moved to the new form2, instead of copied there.
|
|
|
|
|
That's because you're only copying the references to the controls, not the actual controls.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Here is the problem I'm having and maybe some VB6 guru may answer and resolve my problem.
I have WinForm Control created in .NET as an ActiveX control and purfectly registered on the system.
It works fine in any container I have: TstCon32, MFC Dialogs, all Office Applications and etc.
Actually, it works fine even inside VB6 when in Design Mode. When I'm running in VB6 Run/Start(F5) or Start with Full Compile (Ctrl+F5) -- it also works fine. So, I'm assuming that everything is fine with my control.
However, when I'm trying to create Project.exe through File/Make Project.exe VB6 starts compiling the program and when about 10% Progress is shown I'm getting an error message box: "Unexpected error".
So, what could be wrong? And how could I find this out?
Thanx
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I am looking one of those funky Outlook type bars. There is one at the resource page, but it is only a demo, and you have to pay a couple of dollars to buy the source code...
|
|
|
|
|
How about Marc Clifton's Outlook Bar[^]?
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
A very good outlook Bar here + other forms controls :
http://www.divil.co.uk/net/
|
|
|
|
|
A very good outlook Bar here + other forms controls :
http://www.divil.co.uk/net/
|
|
|
|
|
does someone know if its possible to send email in vba using smtp and winsock?
i got a code which works in vb.Using the code in vba seems to be possible
and also the refereces are in vba available but i always get the same message
"objectvariable or with-blockvariable not set"
what does it mean?
here is my complete code,
hope someone can help
Option Explicit
' ----------------------------------------------------------------------------
'
' EVENTS
'
' ----------------------------------------------------------------------------
Public Event Connected(ByVal Host As String, ByVal Port As Long)
Public Event ReceivedData(ByVal Data As String)
Public Event SentData(ByVal Data As String)
Public Event MailCompleted()
Public Event Error(ByVal Error As String)
' ------------------------------------------------------------------------------
'
' PROPERTY VARIABLES
'
' ------------------------------------------------------------------------------
Dim m_Server As String ' mail server host
Dim m_Port As String ' mail server port
Dim m_MailFrom As String ' from address
Dim m_MailTo As String ' to address
Dim m_BCC As String ' blind carbon copy addresses
Dim m_CCC As String ' carbon copy addresses
Dim m_Subject As String ' email subject
Dim m_NameFrom As String ' from name
Dim m_NameTo As String ' to name
Dim m_Body As String ' email body
Dim m_Log As String ' log of transaction
Dim Sock As Winsock
' private state variables
Dim LastResponse As String
' ------------------------------------------------------------------------------
'
' PUBLIC PROPERTIES
'
' ------------------------------------------------------------------------------
Public Property Get Server() As String
Server = m_Server
End Property
Public Property Let Server(ByVal Data As String)
m_Server = Data
End Property
Public Property Get Port() As String
Port = m_Port
End Property
Public Property Let Port(ByVal Data As String)
m_Port = Data
End Property
Public Property Get MailFrom() As String
MailFrom = m_MailFrom
End Property
Public Property Let MailFrom(ByVal Data As String)
m_MailFrom = Data
End Property
Public Property Get MailTo() As String
MailTo = m_MailTo
End Property
Public Property Let MailTo(ByVal Data As String)
m_MailTo = Data
End Property
Public Property Get BCC() As String
BCC = m_BCC
End Property
Public Property Let BCC(ByVal Data As String)
m_BCC = Data
End Property
Public Property Get CCC() As String
CCC = m_CCC
End Property
Public Property Let CCC(ByVal Data As String)
m_CCC = Data
End Property
Public Property Get Subject() As String
Subject = m_Subject
End Property
Public Property Let Subject(ByVal Data As String)
m_Subject = Data
End Property
Public Property Get NameTo() As String
NameTo = m_NameTo
End Property
Public Property Let NameTo(ByVal Data As String)
m_NameTo = Data
End Property
Public Property Get NameFrom() As String
NameFrom = m_NameFrom
End Property
Public Property Let NameFrom(ByVal Data As String)
m_NameFrom = Data
End Property
Public Property Get Body() As String
Body = m_Body
End Property
Public Property Let Body(ByVal Data As String)
m_Body = Data
End Property
Public Property Get Log() As String
Log = m_Log
End Property
Public Property Let Log(ByVal Data As String)
m_Log = Data
End Property
' ------------------------------------------------------------------------------
'
' PUBLIC SUBS
'
' ------------------------------------------------------------------------------
Public Function SendMail() As Boolean
Dim SMTPCommands(0 To 10) As String
Dim SMTPResponses(0 To 10) As String
Dim Success As Boolean
Dim i As Integer
' construct an array of commands
SMTPCommands(0) = "HELO " & Me.Server
SMTPCommands(1) = "MAIL FROM:" & Me.MailFrom
SMTPCommands(2) = "RCPT TO:" & Me.MailTo
SMTPCommands(3) = "DATA"
SMTPCommands(4) = "BCC:" & Me.BCC
SMTPCommands(5) = "CCC:" & Me.CCC
SMTPCommands(6) = "SUBJECT:" & Me.Subject
SMTPCommands(7) = "TO:" & Me.NameTo
SMTPCommands(8) = "FROM:" & Me.NameFrom & vbCrLf ' extra vbCrLf
SMTPCommands(9) = Me.Body & vbCrLf & "."
SMTPCommands(10) = "QUIT"
SMTPResponses(0) = "250"
SMTPResponses(1) = "250"
SMTPResponses(2) = "250"
SMTPResponses(3) = "354"
SMTPResponses(4) = ""
SMTPResponses(5) = ""
SMTPResponses(6) = ""
SMTPResponses(7) = ""
SMTPResponses(8) = ""
SMTPResponses(9) = "250"
SMTPResponses(10) = "221"
' connect to the server
If ConnectToServer = False Then
RaiseEvent Error("Couldn't connect to server")
Exit Function
Else
' wait for the welcome message to be received
WaitForResponse "220"
End If
' send each command, waiting for a response
For i = 0 To 10
' send the command
SMTPSend SMTPCommands(i)
' wait for the response
Success = WaitForResponse(SMTPResponses(i))
' check if we were successful
If Success = False Then
RaiseEvent Error("Failed at server side. Check the SMTP.Log property for more details")
Exit Function
End If
Next i
' finished
RaiseEvent MailCompleted
End Function
Private Function ConnectToServer() As Boolean
' connect to the host
Sock.RemoteHost = Me.Server
Sock.RemotePort = Me.Port
Sock.Connect
' wait for connection
Do While Sock.State <> sckConnected
DoEvents
If Sock.State = sckError Then
Exit Function
End If
Loop
' return true
ConnectToServer = True
End Function
Private Function WaitForResponse(ByVal Response As String) As Boolean
' if we're not waiting for a response then exit
If Response = "" Then
WaitForResponse = True
Exit Function
Else
' wait for the response property to change
Do While LastResponse = ""
DoEvents
Loop
' if it matches, return true, else return false
If Response = LastResponse Then
' return true
WaitForResponse = True
' check for errors
Else
WaitForResponse = False
End If
End If
' clear the static variable for next time
LastResponse = ""
End Function
Private Sub SMTPSend(ByVal Data As String)
' send the passed string with a vbCrLf
If Sock.State = sckConnected Then
Sock.SendData Data & vbCrLf
DoEvents
End If
' raise event
RaiseEvent SentData(Data)
' log
AppendLog Data & vbCrLf
End Sub
Public Sub AppendLog(ByVal Data As String)
' append the passed data to the log
Me.Log = Me.Log & Data
End Sub
' ------------------------------------------------------------------------------
'
' INTERNAL SUBS
'
' ------------------------------------------------------------------------------
Private Sub Sock_Connect()
' raise event
RaiseEvent Connected(Sock.RemoteHost, Sock.RemotePort)
End Sub
Private Sub Sock_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
' grab the data and set the last response
Sock.GetData Data
LastResponse = Mid$(Data, 1, 3)
' raise event
RaiseEvent ReceivedData(Data)
' log
AppendLog Data
End Sub
Private Sub Sock_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
' raise event
RaiseEvent Error(Description)
End Sub
Private Sub UserControl_Resize()
' fit the control to the image
With UserControl
.Height = picImage.Height
.Width = picImage.Width
End With
End Sub
Private Sub UserForm_Click()
' display the form
'Me.Show
' setup the mail control
With SMTP
.Server = "mail.hotmail.com"
.Port = 25
.MailFrom = "testing@winsockvb.com"
.MailTo = "youremailhere@hotmail.com"
.NameFrom = "Me"
.NameTo = "You"
.Subject = "Test mail from WinsockVB.com control"
.Body = "Hello"
' send the mail
.SendMail
End With
End Sub
Thanx
|
|
|
|
|
Add a reference to the CDO com object and use CDO calls to exchange server.
There are several varieties of CDO calls so pick the one that suits your needs.
|
|
|
|
|
Hi,
I wanted to know if DataSet can be used as a Data Structure in Visual Basic.NET
|
|
|
|
|
I am near the end of a program. This program accesses rich text files and jpeg files using the app path method. This works well while the program is contained within the same folder as the files.
I want to have the compiled program in "program files" and have the program access the rt files and jp files from the cd rom no matter what drive letter is assigned to the rom.
Mark
|
|
|
|
|
I think you want to know which one is the CD-ROM drive :
use these APIs:
FindFirstVolume<br />
FindNextVolume to search volumes
and
GetVolumeInformation
to check file system..
|
|
|
|
|
after searching high and low i am unable to find anything in .net or 3rd parties for converting rtf or any text to postscript.
is there any classes in the .net framework that allows this to happen dynamically? i have an rtf interface application written in vb.net that i want to write out to postscript.
can anyone point me in a direction that will that the rtf to postscript?
joe
|
|
|
|
|
I'm trying to load an image file from a web server. The request simply fetches a file from an HTTP location that I know exists (it loads in IE).
However, when I run the program I get the following:
System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required.
I don't know of any changes to our ISA server, but I have SP4. Does anyone know how to fix this?
Lost
|
|
|
|
|
Hi
If i print a graphic created using .net code directly to the printer, it is very neat. But if I save the same as a BMP file and print the output is not as sharp... can anything be done to retain the sharpness
|
|
|
|
|
how can i change icon of my VB exe if it doesn't have any forms.
my app has no gui interface (only modules and classes)
any clues!
rIsHaBh
|
|
|
|
|
is it possible to set icon for executable (which has no forms/gui) without using any external add-ins
rIsHaBh
|
|
|
|
|
If I have an application that uses the FromFile("Pathname") method, how can that code recognize where to find that file on another computer.
For example, if I want to display a picture that I'm developing on my computer and I use the FromFile("C:\my Bitmaps\Pic.bmp") that's all fine and dandy.
But if I were to install that application on another computer, and when deployed, generically dumps every dependent file into "C:\Program Files\WindowsApplication1", the path I originally gave to find the Bitmap "C:\my Bitmaps\Pic.bmp" will no longer be valid.
How can I make it so that when the application is installed on another computer, all the paths will be correct?
Thank you
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|
|
I am not sure I understood your question correcty, but:
1. If the user wants to open an arbitrary picture on your program, you can use the OpenFileDialog class to get the path and then use that path on Bitmap.FromFile() method.
2. If you are talking about a picture that you want to distribute with your program, install it in the same directory as your executable and use something like Application.StartupPath + "\pic.bmp" or embbed it in the executable.
|
|
|
|
|
I think the second option is the one I was looking for.
Let's say under the Form_Load event, I want the form to open up with a picture. On my computer, the picture is located at C:\my pics\Pic.bmp, but if I were to install this program at on another person's computer, it would install at the default location C:\Program Files\WindowsApplication1\Pic.bmp, and when he would try to run the program, it would not find the picture because my code is looking for C:\my pics\Pic.bmp, not the other path.
So instead of using BitMap.Fromfile("Path") just use Application.StartupPath & "\Pic.bmp" ?
Also, how could I embed a picture or a WAV into the executable?
thanks
The Jazz Master 6000
DJ Badknees
Parma Grind Crew - www.geocities.com/parmagrindcrew
|
|
|
|