|
Thanks for the code... technically that should work, but I create my rich text box at runtime, so i cant call its events, or atleast... i am unsure of how to! please help? thanx guys!
|
|
|
|
|
DaxBooysen wrote: i am unsure of how to! please help?
replace textbox with Richedittextbox
Actually i tried it with textbox.It is very simple. replace textbox with richedittextbox
|
|
|
|
|
I have no problem with that, its the fact that i create it at RUNTIME... i dont place it on my form at design time, so when i try make an event for a text box that has not been created yet i cant! know what i mean? thanx again!
|
|
|
|
|
ok What code u r writing?
|
|
|
|
|
i create a rtf box in many places and set it as a child control of a tab control... but i call it up like this when i want to change its values...
<br />
<br />
Dim rtf As New RichTextBox()<br />
rtf = TABS.TabPages(TABS.SelectedIndex).Controls.Item(0)<br />
<br />
and so you see... since its created at runtime... how do i call its events? thanx,
dax
|
|
|
|
|
then write the code on each control which is provided to u.
|
|
|
|
|
DaxBooysen wrote: Dim rtf As New RichTextBox()
rtf = TABS.TabPages(TABS.SelectedIndex).Controls.Item(0)
Doesn't this create a control, then discard it for one that's already within the tab page ?
Either way, you can attach events to a control in code, at least you can in C#.
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 )
|
|
|
|
|
If you create a control at runtime, you have to wire up the events yourself at runtime, just like the designer generated code does when you drop a control on the form.
Lookup AddHandler and RemoveHandler on MSDN and it'll show you how to do this...
|
|
|
|
|
THANX!!! you rock man! that worked!
|
|
|
|
|
Is there any event that automatically get fired when the mouse goes out of the form.
|
|
|
|
|
That would be the 'leave' event ( or 'mouseleave' ). I've found it more reliable to set a timer and check for myself if the mouse is still over the 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 )
|
|
|
|
|
you should use mouseleave event
|
|
|
|
|
That's what I said, but I recall it not worknig out for me at times, hence my suggesting an alternative.
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 want to send this command to epp.registry.tryout.be at the port 33128. This is an EPP server which is to be connected through SSL connection
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<hello/>
</epp>
This will generate a Greeting in the same (XML) format. I want to store that greeting to a string using some xml parser i am not sure.
Please help and provide the code in vb.net
Thanks
|
|
|
|
|
Hi
Using VBA for Excel - Office XP and 2003
We have an file on a network with a production schedule, that is accessed and modifeid by a couple of users. I am using the Workbook's BeforeSave event to prompt the person who is trying to save the Workbook to send an email to other useds advising them of the changes to the production schedule.
Two questions:
1) How can I get the current Users name? - Not to worry, I have found this!!
2) When I send the mail, I get a pop-up from Outlook saying that another program is tying to send mail, and you then have to click 'Allow for ? Minutes, and say yes. Is there any way to stop this pop-up? I dont mid if the email appears, and the user must clicjk 'Send', but also could not get the code for that. (I.e in the code below, I go myMailItem.Send - I tried myMailItems.Show, but this does not work.
This is the code I am using:
Dim response As String
response = MsgBox("Would you like to email Andrea advising of the the changes you have just saved?", vbYesNo)
If response = 6 Then
Dim User As String 'How do I get UserName ?????
Dim myOutlook As Object
Dim myMailItem As Object
Set myOutlook = CreateObject("Outlook.Application")
Set myMailItem = myOutlook.createitem(0)
myMailItem.Recipients.Add "<name@domain.com>"
myMailItem.Subject = "Production Schedule Changes"
myMailItem.body = "Hi Andi" & Chr(13) & Chr(13) & _
"Please see the latest changes in the Production Schedule" _
& Chr(13) & Chr(13) & "Regards"
myMailItem.Send
Set myOutlook = Nothing
Set myMailItem = Nothing
End If
-- modified at 5:30 Friday 11th May, 2007
|
|
|
|
|
Hello all,
I am cracking my brains for two weeks now on the following problem:
I have to update records on a table but i am now in the stiuation that i get the message "parameter @NummerNaam has no default value"
I have posted this question once, thanks for the tips.
I also read several documentation but still get stuck.
Below my code.
Thanks,
Bas
Dim command As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand("Update Agent" & _
" SET Nummer_Naam = @NummerNaam, Agentnummer = @AgentNummer, Agentnaam = @AgentNaam" & _
" WHERE(Agentnummer = @agentNummerOud)", dcAgent)
command.Parameters.Add("@NummerNaam", OleDb.OleDbType.VarChar, 20, "Nummer_Naam")
command.Parameters.Add("@AgentNummer", OleDb.OleDbType.Integer, 10, "Agentnummer")
command.Parameters.Add("@AgentNaam", OleDb.OleDbType.VarChar, 20, "Agentnaam")
Dim parameter As System.Data.OleDb.OleDbParameter = command.Parameters.Add( _
"@agentNummerOud", OleDb.OleDbType.Integer, 10, agentNummerOud)
parameter.SourceVersion = DataRowVersion.Original
command.Connection.Open()
command.ExecuteNonQuery()
command.Connection.Close()
|
|
|
|
|
You created four parameter objects, but you didn't assign values to any of the parameters. You can change that by doing something like this:
command.Parameters.Add(new OleDbParameter("@NummerNaam", OleDb.OleDbType.VarChar, 20, "Nummer_Naam")).Value = somevalue
command.Parameters.Add(new OleDbParameter("@AgentNummer", OleDb.OleDbType.Integer, 10, "Agentnummer").Value = somevalue
command.Parameters.Add(new OleDbParameter("@AgentNaam", OleDb.OleDbType.VarChar, 20, "Agentnaam").Value = somevalue
|
|
|
|
|
Hello Dave,
Thanks for the tip.
Now i get it.
I wil try this.
|
|
|
|
|
Hello Dave,
I tried, it works fantastic.
Thanks guru!!
|
|
|
|
|
Is it write to say that
an event is
private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load
End sub
and functions is
private function abc()as string
end function
|
|
|
|
|
Nilish wrote: handes MyBase.Load
This bit means that this function will be called in response to an event.
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 )
|
|
|
|
|
private sub Form_Load(byval sender as system.Object,byval e as System.Eventargs)handes MyBase.Load
End sub
This Form_Load is a event handler for Load event. That means when the page load event fires this handler will be invoked.
Then, then function
private function abc()as string
end function
This is need to call as abc() for executing.
Gg
|
|
|
|
|
Private sub Form_Load... isn't an event. It's a procedure that handles an event. Any procedure can handle an event as long as it matches the signature of the event. A function returns a value while a procedure does not.
This is how you could define an event.
Public Event SomeEvent(ByVal sender As Object, ByVal e As System.EventArgs) The signature would be the parameters in the definition. I could also create an event like this.
Public Event AnotherEvent(ByVal someText As String)
In this case the procedure to handle this event would need to accept a string. Any procedure that does so can handle this event. It's good practice to create events that with the .net signature of (sender, e) where sender is an object and 'e' inherits from system.eventargs.
|
|
|
|
|
What is the meaning of List<AssemblyInformation>assemblies.Actually this code line belongs to C#.I am writing in this fomum because i wanted the equivalant syntax in vb.net.And one more thing what is the meaning of this line.
|
|
|
|
|
It defines a strongly-typed List of AssemblyInformation objects called assemblies . The VB.NET version would read:
Dim assemblies As New List(Of AssemblyInformation)
|
|
|
|