|
In that case, you handle the KeyDown event of the DGV and check the event args KeyCode property for the Keys.Tab key. If pressed, you have to check to see what the cuurnet cell is. If the current cell is the last one, you set the Handled propery of the event args to True and make your changes to the TabControl. Otherise, you do nothing.
|
|
|
|
|
I'm having a problem getting a textbox to display some data. The application is recording sound and I wanted to see a few pieces of data as it comes in. I set the text property from within a thread and it doesn't do anything, not even display a zero.
I've checked as the obvious stuff; the textbox1.text code is being executed, and there isn't any other code relating to textboxes anywhere else that would overwrite it. Any help would be appreciated
|
|
|
|
|
I'm surprised it doesn't blow up. In VB2005, accessing a form control from a thread that didn't create it, should blow it up.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
So what should I do to get around this problem? Does it apply to other controls to?
|
|
|
|
|
It applies to every control. You cannot modify a control from a thread other than the one that created the control.
Christian is correct, this should have exploded when the code got to updating the control. This tells me that either you've set that nasty little property called "CheckForIllegalCrossThreadCalls" to False, or you're wrapped the code that updates the checkbox in a Try/Catch block that's eating the exception that gets thrown.
You have to provide a method on your form to update the TextBox, create a delegate for it, then you Invoke that method to update the TextBox. From memory, it goes something like this:
Public Class Form1
Private Delegate Sub UpdateTextBoxDelegate(ByVal message As String)
Public Sub UpdateTextBox(ByVal message As String)
If TextBox1.InvokeRequired Then
TextBox1.Invoke(New UpdateTextBoxDelegate(AddressOf UpdateTextBox), New Object() {message})
Else
TextBox1.Text = message
End If
End Sub
This sub can be called from from code on the form running from any thread and the call will get marshaled back to the UI thread to update the textbox. All you have to do is call the sub:
UpdateTextBox("Some string...")
|
|
|
|
|
Hi all,
I want to know is there some way to execute a report from SQL Server 2005 Report Service? Honestly., i'm not really familiar with VB..in VS.Net I can execute the report using reportviewer control, but I can't find any similar control in VB6 form.
So please., if any of you can show me how to do it(if it is possible)..I'll realy appreciate it guys
|
|
|
|
|
Why go back to VB6, Microsoft have giveup on it.
Stick to .NET or you will have Problems, just look at vb6 and look at SQL 2005, do you think they can be friends?
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Actualy I'm personally prefer to use .Net to use SSRS for new application but in this case I have several application that already running on VB6 and I wondering if those applications can use SSRS as Reporting media.
So if there any information about it..please inform to us. Thanks ..
|
|
|
|
|
Am Sorry my friend this time you cant
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I just started an entry level programming job. I am familiar with basic vb.net programming. Our company uses vb.net 2005. They are programming at a level far beyond my knowledge. I have looked at books but they are all very basic and are no help to me...
my question is what is a good programming book for intermediate programmers in vb2005?? I need something also that goes into detail about debugging applications because I never got into that very in depth in school.
Erica
|
|
|
|
|
This is an awesome question BTW. I wish more people here would read books.
This[^] looks like a good overview on debugging, basically you set a breakpoint, the code will stop there and you can examine variable values and step through your code to see what it's doing.
The main thing you need to do, is to make sure you don't try to hide what you don't know. If you show an attitude of willingness to learn, and are open about where you need help, any company should see that as an assett. It's the ones who try to hide their problems that are a burden.
When you say 'intermediate', what sort of stuff do you know, and what sort of stuff is confusing you ? I'd buy a non beginner book, here[^] are some books that mostly seem like good candidates. If the book is at too high a level on some things, you can always use the keywords you get from the section ( such a generics ) and google for articles, or ask specific questions here if you're stuck.
Christian Graus - Microsoft MVP - C++
"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'm trying to pass data from one open form to another open form in vb.net 2005
simple example: Form1 and Form2 are on your screen
Form1 has a textbox let us say textbox1
and Form2 has a button
when I press the button on Form2, textbox1 on form1 must show a simple text
Form1 and textbox1 are public
so on Form2 when I press the button, I can say Form1.textbox1.Text ="test"
but nothing happens on Form1
I thought it would be easy to do but I'm a system administrator not an experienced programmer
|
|
|
|
|
You mean like this?
Form 1:
<br />
Public Class Form1<br />
<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim form2 As New Form2<br />
form2.ShowDialog()<br />
End Sub<br />
<br />
End Class<br />
Form 2:
<br />
Public Class Form2<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
Form1.TextBox1.Text = "test"<br />
Me.Close()<br />
End Sub<br />
<br />
End Class<br />
Or am I over simplifying it?
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Form1 and Form2 have to be both open on the screen.
Because I'm going to use this with a docking window. In your example not both windows are open on screen. I allready tried setting the textbox text property before showing form1 this works. But In my case Form1 is allready shown on the screen.
thx for the fast response
|
|
|
|
|
I assume they are not called form1 and textbox1 in real life.
You should not make your UI controls public. Set up delegates between the two forms, so that they can pass data to each other.
In form1
public delegate void Textbox1Changed(string text);
public Textbox1Changed OnTextbox1Changed = null;
in your text changed event:
if(OnTextbox1Changed != null ) OnTextbox1Changed(text);
Sorry, this is C#, I don't know enough VB to get the syntax right.
Then, form2 has a method which as this signature, and you hook it up to this delegate, the method in form 2 will be called when the event in form1 is fired
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hi
I have a VB.Net 2005 Remoting Project. A service that is exposing the dot net remoting object on the server and a windows application as a client.
But when I run the client form any pc I get the following error
"A remote side security requirement was not fulfilled during authentication. Try increasing the ProtectionLevel and/or Impersonationlevel."
If any one can help
Thanks in Advance
|
|
|
|
|
Is the server object exposed in a service? Is the service running?? Is the server running on a seperate machine from your client?? What account is it running under?? Are both machines in the same domain or they in a workgroup configuration?? Is the server running on Windows XP?? If so, does this machine have simple file sharing turned OFF??
|
|
|
|
|
Hi Dave
The Service is running,one can access the port and Ip form another machine using telnet. The service is running on a seprate machine to the client. The Machines are on the same network so in other words they are connecting directly to each other. Simple file Sharing is turned off on the client and on the server.
Thanks in Advance
|
|
|
|
|
Are the machines in a domain enivronment or workgroup?? What user account in the service running under?? What user account is client code running under??
|
|
|
|
|
The Client and the server Service is both running on the administrator account. The network setup is a work group.
|
|
|
|
|
Hi Dave
I have played around with the TcpChannel Properties but the problem I am running into now is the following error:
The server has rejected the client credentials.
Thanks in advance
|
|
|
|
|
Under remoting, the code on the server instantiates an object using the context of the CLIENT, not the server. Your user account that your logged in under on the client machine becomes part of your context. This context is a security boundry.
In a workgroup environment, the account you're using on the client, even though it has the exact same name, is different from the account on the server. Each machine maintains it's own list of user accounts and does not trust the accounts of another machine. In a domain, the machines in it all trust the same list of user accounts.
So, in your setup, the Administrator account on your client workstation is NOT trusted by the server instantiating your remote object, thus the object can't be created. The server tries to create the object using the clients account and gets denied because the client account has no permission on the server.
So, what does the remoting config in your app.config files look like, both server AND client?? Remember to check the little box that says "Ignore HTML tags..." before you click "Post Message".
|
|
|
|
|
Hi Dave
The system I am working on doesn't use a configuration file
But here is the code
================================================================
Server : This code is run onstart of the service
================================================================
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
RemotingConfiguration.ApplicationName = "Indicium"
Dim ChannelProps As New Dictionary(Of String, Object)
ChannelProps.Add("port", "50000")
ChannelProps.Add("secure", "false")
ChannelProps.Add("name", "Server")
Dim cProv As New BinaryClientFormatterSinkProvider
Dim sProv As New BinaryServerFormatterSinkProvider
sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv)
ChannelServices.RegisterChannel(myChannel, True)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(RemotingGateway), _
"Indicium", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(KVGenerator), _
"KVGenerator", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(Importers.BankImporter.Gateway), _
"BankImporter", WellKnownObjectMode.SingleCall)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(Stats.clsGateway), _
"Stats", WellKnownObjectMode.SingleCall)
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.RemoteOnly
SSIDataInterface.ClientPlug.Init("", "", "")
End Sub
======================================================================
Client
======================================================================
Dim serverIP As String = _MyConfig.serverIP
Dim serverPort As String = _MyConfig.serverPort
_serverAddress = "tcp://" & serverIP & ":" & serverPort
Dim serverURI As String = _serverAddress & "/Indicium"
' Create a connection to the Indicium Server...
Dim ChannelProps As New Dictionary(Of String, Object)
ChannelProps.Add("name", "Client")
ChannelProps.Add("port", serverPort)
ChannelProps.Add("secure", "false")
ChannelProps.Add("username", "Petrus")
ChannelProps.Add("password", "hallo1231983")
Dim cProv As New BinaryClientFormatterSinkProvider
Dim sProv As New BinaryServerFormatterSinkProvider
sProv.TypeFilterLevel = Runtime.Serialization.Formatters.TypeFilterLevel.Full
Dim myChannel As New TcpChannel(ChannelProps, cProv, sProv)
Try
ChannelServices.RegisterChannel(myChannel, True)
Catch ex As Exception
MsgBox("Channel Feed Back : " & ex.ToString())
End Try
IndiciumGateway = CType(Activator.GetObject(GetType(IGateway), serverURI), IGateway)
=================================================================================================
If you suggest i use a configuration file do I use on the server
RemotingConfiguration.Configure()
and would it look like this and what do I need to change to make it work for my setup and what type of assembly should be named in the activated type of assembly and the wellknown type Assembly
<Configuration>
<system.runtime.remoting>
<application>
<service>
<welknown mode="SingleCall" Type="RemotingGateway,IndiciumServer" objecturi="Indicium" />
<activated type="ClientActivatedType, TypeAssembly"/>
</service>
</application>
</system.runtime.remoting>
</Configuration>
PS: Is the assembly type the project name that contains the class that is marshallbyrefOject
|
|
|
|
|
I always use a config file for remoting. It saves having to make changes, compile, and reploy if something has to change.
In your ChannelProps dictionary, you're specifying the port and secure properties as strings. Remove the quotes and let them be the types they actually are.
Dim props As New HashTable()
props("port") = 50000
props("secure") = False
You can get rid of the username and password properties. They're not valid properties for a server-side TcpChannel.
You can also get rid of the MsgBox in your OnStart code when you call RegisterChannel. You'll never see it if it does pop up. Replace this with either writing to your own log file or one of the Event Logs.
|
|
|
|
|
Dear Dave
The error I am Exsperiancing now is
No Connection could be made becase the target machine actively refused it
Is this type of setup possible for WorkGroup And if so what needs to be changed on the configuration for this to work.
Thanks in advance
|
|
|
|