|
I think you can't set focus in form load because the UI of the form is not completed its setup yet. If you want a certain control to have focus on display, try setting it's tab index to the lowest value among controls on the form that can receive focus.
A person with one watch knows what time it is; a person with two watches is never quite sure ...
[remove "NFS-" from email (No Freaking Spam)]
|
|
|
|
|
Blasier is right about the controls. You can't execute methods on the controls in the Form_Load event. You can either set the TabStop to 0 for that textbox or you could do the .SetFocus() method on Form_Activated. But, using the Activated event has it's drawbacks. If the user switches to another app, then back to yours, the Activated event will fire. Same thing if you .Show() or .ShowDialog() another form. The end result of this will be that the focus will alwyas return to the same control when the user goes back to your form.
The best method is to set the TabStop on that control to 0.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I got this code:
<br />
dim frm1 as new frmLogin<br />
dim frm2 as new frmMain<br />
sub main<br />
application.enablevisualstyles()<br />
frm1.showdialog()<br />
<br />
application.run(frm2)<br />
end sub<br />
It seems that the first form does not get the xp visual styles and the second form does. Is this a bug or is this expected? Can I ask why? Is there a work around? I need the first form to come before the second form so that I can configure the second form appropriately.
|
|
|
|
|
That's because you have the Application.EnableVisualStyles() in the wrong place. It should go before the Application.Run() for your main form, not inside it. The proper place for it in the Main function of your code. Just use Edit/Search and you'll find it. Also, put an Application.DoEvents() between the .EnableVisualStyles and the .Run for your app:
Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(new Form1())
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,may i know is it possible to convert speech to text with vb.net?May i know where will have such source of code for reference?thanks!!!
|
|
|
|
|
There is not native supprot for it in the .NET BCL. You'll have to download and use the Speech SDK 5.1, here[^], or wait until the Speech.NET SDK is available. In either case, both will come with sample code. Although the SDK 5.1 will not be VB.NET specific, it can still be converted to VB.NET and used.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks!
By d way,may i know without Speech SDK 5.1,will i be able to develop text-to-speech and voice recognition program by using VB.NET?
From my research,i had get few sample program on text-to-speech.But when i try to develop same program,i found few component is not available like AxHTTSLib.Is it because i don't have d Speech SDK 5.1 software?
Thanks!!!!!;)
Thanks
|
|
|
|
|
MLSL wrote:
By d way,may i know without Speech SDK 5.1,will i be able to develop text-to-speech and voice recognition program by using VB.NET?
Not unless you want to develop your own Speech SDK from scratch. Good luck, you've got alot of research to do!
MLSL wrote:
From my research,i had get few sample program on text-to-speech.But when i try to develop same program,i found few component is not available like AxHTTSLib.Is it because i don't have d Speech SDK 5.1 software?
YES! You need the SDK in order to do this.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Helo, how can I connect an application to a database (SQL server) that reside in site that need connected through internet?
Thanks
Learning .NET
|
|
|
|
|
Provided any firewalls in the way have the proper holes punched in them (ports opened up), you don't need to do anything special. Just include the complete Internet address of the server in your connection string. I don't think you would really want to expose an SQL server to the VERY HOSTILE environment known as the Internet, though!
A sample connection string:
Initial Catalog=MNFPool;User ID=MNFPoolUser;Password=MNFPoolUser;Data Source=mySQLserver.whateverdomain.com;
or you could use an IP address as the Data Source:
Initial Catalog=MNFPool;User ID=MNFPoolUser;Password=MNFPoolUser;Data Source=53.200.154.20;
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
I don't think you would really want to expose an SQL server to the VERY HOSTILE environment known as the Internet, though!
TO that end we've been using SQLXML / SOAP here - once you get your head around it, it's not too tricky to set up, but does have some limitations etc...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I am trying to use the use Mscomm32.ocx, but it gives me an exception stating that I don't have the liscense to use it, even after I use regsvr32 to register it. any thoughts?
|
|
|
|
|
I take it your using VB6? This was a know issue that has nothing to to with the component registration. See this[^] Microsoft KB article for the fix.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
I take it your using VB6?
No, I am using VB .Net.
Thanks for the link to the article, but it was for VB6. I am trying to use the version of the library under Windows\System32.
|
|
|
|
|
Same thing applies. The license is for the design-time fix of the control, not VB6...
What are you trying to use the Comm Control for anyway. There's already .NET libraries that can handle serial and parallel I/O without resorting to ActiveX controls, such as this[^] article on CodeProject.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks. I don't like using other people's code, but I will write my own library using the methods discussed in the article.
Kyle
|
|
|
|
|
What do you call using an .OCX file? It's just somebody else's code, but in this case, it's really old school code.
I have to congratulate you on wanting to write your own class for Serial Comm. It's the best way to learn and to get all the features you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a simple question. I'm just wanting to validate a text box to make sure it has only numbers and 1 period. Is there a simple expression for this? Thanks!
|
|
|
|
|
You can use a regular expression to validate the input. Also, if you use a regex and the input in invalid, it can return the closest match to the format that is needed. Say the user inputs 123.453.24265. The following regex will return a match with 123.45:
^([0-9]{1,}.[0-9]{0,2}){0,1}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm having some issues with an attempt to serialize an object to file using a BinaryFormatter. The error I keep getting is:
The type System.Runtime.Remoting.ServerIdentity in Assembly mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 is not marked as serializable.
Problem #1, I have no idea where I am referencing ServerIdentity. This is the method I am running in at the time of error:
Private Shared Sub DumpUnprocessedDeployments()
Try
Dim cntr As Integer = CollInstance.Count
If cntr > 0 Then
logger.WriteLog("Dumping " + cntr.ToString.Trim() + " unprocessed deployments....")
Dim s As Stream = File.Open("bin\webdeploy.dmp", FileMode.OpenOrCreate, FileAccess.ReadWrite)
Dim bf As New BinaryFormatter
Dim dpl As Deployment
Dim al As New ArrayList
For Each dpl In CollInstance
logger.WriteLog(dpl.Project + " " + dpl.State + " " + dpl.Package + " Requester: " + dpl.User, False)
bf.Serialize(s, dpl) ' <=== ERRORS OUT HERE
Next
s.Close()
Else
logger.WriteLog("No Unprocessed Deployments to Dump")
End If
Catch ex As Exception
logger.WriteLog("An ERROR was Encountered while Generating the Dump File....")
logger.WriteLog(ex.Message, False)
End Try
End Sub
Here is the Code for the Serialized Object:
Imports System
Imports CM.WebDeployment.Interfaces
<serializable()> Public Class Deployment
Inherits MarshalByRefObject
Implements IDeployment
Private IsPending As Boolean
Private RunWhen As Date
Private FTPDir As String
Private FTPPwd As String
Private FTPSvr As String
Private FTPUsr As String
Private HPkg As String
Private HPwd As String
Private HProj As String
Private HState As String
Private HUsr As String
#Region " Object Constructor(s) "
Public Sub New()
MyBase.New()
End Sub
Public Sub New(ByVal HarProj As String, ByVal HarState As String, ByVal HarPackage As String, _
ByVal HarUser As String, ByVal HarPassword As String, ByVal FServer As String, _
ByVal FDir As String, ByVal FUser As String, ByVal FPassword As String, _
ByVal RunTime As Date)
MyBase.New()
HProj = HarProj
HState = HarState
HPkg = HarPackage
HUsr = HarUser
HPwd = HarPassword
FTPSvr = FServer
FTPDir = FDir
FTPUsr = FUser
FTPPwd = FPassword
RunWhen = RunTime
End Sub
#End Region
#Region " Implemented Properties From IDeployment "
Public ReadOnly Property FTPDirectory() As String Implements Interfaces.IDeployment.FTPDirectory
Get
Return FTPDir
End Get
End Property
Public ReadOnly Property FTPPassword() As String Implements Interfaces.IDeployment.FTPPassword
Get
Return FTPPwd
End Get
End Property
Public ReadOnly Property FTPServer() As String Implements Interfaces.IDeployment.FTPServer
Get
Return FTPSvr
End Get
End Property
Public ReadOnly Property FTPUser() As String Implements Interfaces.IDeployment.FTPUser
Get
Return FTPUsr
End Get
End Property
Public ReadOnly Property Package() As String Implements Interfaces.IDeployment.Package
Get
Return HPkg
End Get
End Property
Public ReadOnly Property Password() As String Implements Interfaces.IDeployment.Password
Get
Return HPwd
End Get
End Property
Public ReadOnly Property Project() As String Implements Interfaces.IDeployment.Project
Get
Return HProj
End Get
End Property
Public ReadOnly Property RunTime() As Date Implements Interfaces.IDeployment.RunTime
Get
Return RunWhen
End Get
End Property
Public ReadOnly Property State() As String Implements Interfaces.IDeployment.State
Get
Return HState
End Get
End Property
Public ReadOnly Property User() As String Implements Interfaces.IDeployment.User
Get
Return HUsr
End Get
End Property
#End Region
Public Property Pending() As Boolean
Get
Return IsPending
End Get
Set(ByVal Value As Boolean)
IsPending = Value
End Set
End Property
End Class
Problem #2, this was working 3 days ago (no changes made to the Deployment class).
Any help on this would be great.
|
|
|
|
|
Helo, I want to setup an setup project. In my setup project, I want to include two solution, how can i do that? I also want to include sound to my project. How can i add music to the setup project?
Thanks for your idea...
Learning .NET
|
|
|
|
|
Using the VS Installer project, you can't do either without coding custom actions.
You'll have to add custom actions to the setup project to get it add multiple solutions. You can add multiple PROJECTS, but not solutions. The VS Installer project is just that, a project that is part of a solution, the installation part.
Sound would require you to add code to unpack, then play an .AVI. It is possible to do using Wise Package Studio. I don't know how to do it using the VS Installer project. I also, have no examples...
[EDIT]
I should've woke up first before I posted! The easiest way to add sound is to write your own SETUP.EXE that wraps the .MSI file. Your SETUP would have the forms and stuff to find out what the user wants to install, OK the license agreement, yada, yada, yada, ... Your SETUP would also have to call into the Win32 Multimedia API to play the sound file you include with the SETUP package. Whn you have all of the setup options, you would launch the .MSI installation using the appropriate command line parameters to launch a silent and unattended install.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello
if newline (\n) coding is vbclrf
then a tab between word (\t) coding is.......
can i know the answer please
thank you in advance
Gary
|
|
|
|
|
For the tab and newline characters, in VB.NET you can use the ControlChar constant:
ControlChar.NewLine ' Generates a newline.
ControlChar.Tab ' Generates a tab.
Hope this helps. Best of luck in your programming efforts!
Happy Programming and God Bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
hello
how to use this controlchar.newline & controlchar.tab?
a small example
i wish to print the example like below
Name Age
Gary 18
i wish to print or show this sample of result in textbox
may i know how it could be done?
thank you
Gary
|
|
|
|