|
I know it seems silly. I was hoping to limit my coding.
This is what I am trying to do...
I have a combo box with (=, <, >, <>) operators in it and a piece of code that executes depending on the operator the user selects. Without the option to assign the operator a variable my coding become slightly longer with the use of a select statment that checks each possible option.
Thanks,
|
|
|
|
|
Unfortunately, that's what your going to have to do. Even if you were to make a class that did something like, internally, the class would have to check to see which operator was involved, then make the appropriate branch to do the comparison.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
We have a WinForms component in it's own assembly which is used in our .NET desktop app; the window is set by the app to be an MDI child in the app's MDI window.
The component can also be used by other .NET apps that set a ref to our library. Lastly, the component can also be used as a standalone window for apps do not wish an MDI child for its functions.
Is there any way to expose this .NET component so that a COM app (C++ or perhaps VB6) could use the component as an MDI child?
Thanks ... Blaiser
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)]
|
|
|
|
|
Well, it's too much to go into in the Forums. I'll say that is should have been a desgin consideration before you even started to code this. Yeah, it's going to be that messy... ThNick Parker put together a great little article[^] that describes what needs to be done, complete with examples.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello VB Gurus!
I have got a very little problem here. I got "an invalid procedure call or argument" when I inserted this code on on the Form_Load procedure:
txtDescription.SetFocus
With this, I could not have the text object, txtDescription, focused on form start-up.
Please check.
Thanks,
dj41984
"All we need are ones like you"
|
|
|
|
|
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
|
|
|
|