|
In my program, when a specific action is taken, the form generates a tablelayoutpanel. this table layout panel requires, in different circumstances, to have a different amount of cells. The cells need to be of equal size. How would i go about this? I have no idea how to programatically set the amount of rows and columns, is there a way?
Posted by The ANZAC
|
|
|
|
|
Hi,
Could anyone help me?
I'm trying to set a text box so the contents scrolls across the screen (right to left - like a news ticker). I've found some part examples using picture boxes, but was hoping for something more basic, with just a textbox/label etc - and a timer. It doesn't matter if the motion is jerky - so long as it works!
I was thinking it would be something like sending the text to a temp location then on a timer tick it changes whats in the text box so everything it one/two characters further over. I'll need to make sure the whole message is displayed before the first letter reappears at the start.
Any help would be much appreciated
I'm using Visual Studio 2003 (VB.net)
Many thanks
Matt
|
|
|
|
|
Might be a bit messy, but i did throw it together in a couple of mins so...:
Dim text As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
text = Me.Label1.Text<br />
End Sub
Dim leftbound As Integer = -1<br />
Dim Right As Boolean<br />
<br />
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick<br />
If Me.Label1.Text = "" Then<br />
Me.Label1.Location = New Point((Me.Width - leftbound), Me.Label1.Location.Y)<br />
Right = True<br />
End If<br />
If Me.Label1.Location.X = leftbound Or Me.Label1.Location.X = leftbound + 1 Then<br />
If Me.Label1.Text <> "" Then<br />
Me.Label1.Text = Label1.Text.Remove(0, 1)<br />
End If<br />
Right = False<br />
ElseIf Me.Label1.Text = text Then<br />
Right = False<br />
Me.Label1.Location = New Point(Me.Label1.Location.X - 2, Me.Label1.Location.Y)<br />
ElseIf Right = True Then<br />
If Me.Label1.Text.Length + 1 <= text.Length Then<br />
Me.Label1.Text = text.Remove(Me.Label1.Text.Length, text.Length - (Me.Label1.Text.Length + 1))<br />
Me.Label1.Location = New Point(Me.Label1.Location.X - 1, Me.Label1.Location.Y)<br />
End If<br />
End If<br />
End Sub
Posted by The ANZAC
|
|
|
|
|
Thanks, I've tried that - however it isn't quite what I was after. The label box in that example has to be big enough for the for the entire message els it wont all be displayed. Say the label is wide enough for 30 characters, but the message is 45 - is there a way to scroll the entire message across the box before restarting?
Thanks for your help
|
|
|
|
|
Maybe save the trouble and download a marquee control, i'm sure there are plenty available,
Posted by The ANZAC
|
|
|
|
|
Dim s As Integer = 70<br />
text = Me.TextBox2.Text.PadLeft(s) & Me.TextBox2.Text.PadLeft(s)<br />
Me.TextBox2.Text = text<br />
<br />
Dim c As Integer = 0<br />
<br />
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick<br />
<br />
Me.Timer2.Interval = 60<br />
If c = text.Length Then<br />
c = 0<br />
Else<br />
c += 1<br />
Dim a As String = text.Remove(c, text.Length - c)<br />
Me.TextBox2.Text = Mid(Me.TextBox2.Text, 2) & a.Remove(0, a.Length - 1)<br />
End If<br />
<br />
End Sub
Note: Set s until you get desired effect
Posted by The ANZAC
|
|
|
|
|
Thanks for that.
It scrolls perfectly
VB doesn't seem to like this line though
text = Me.TextBox2.Text.PadLeft(s) & Me.TextBox2.Text.PadLeft(s)
Also I can't see how to change the text in the scroll, I tried but after the first time it scrolls I just get "Form1Form1" etc repeated.
Thanks again
|
|
|
|
|
I'm not sure how to fix either of those issues as i didn't have either of them, sorry about that.
Posted by The ANZAC
|
|
|
|
|
Ok thanks
It didn't like that first line as it said "text" had not been declared.
I'll have a play around with it.
Edited to add:
I've got it just scrolling my text now - it only scrolls once though then the box stays blank, so I still need to have more of a play around
Thanks
-- modified at 10:11 Monday 2nd April, 2007
|
|
|
|
|
Sorry in the code i posted just before i meant to declare text outside of any subs, this shoul work with the original code, it did on mine.
Posted by The ANZAC
|
|
|
|
|
The only way I got it to accept those two lines were to put it inside the windows form generated code.
It works fine then - just adds whatever text I give it to the form caption bar too!
Matt
|
|
|
|
|
hey ive been messing around with vb .net 2005 and i got an idea to attempt a program that uses voice recognition. ive looked around and ive seen code in other languages and not really vb .net (i saw one in vb 6 but i dont have that). i was wondering if anyone could point me in the right direction of where to begin in trying to start voice recognition, thanks
|
|
|
|
|
Do a search on MSDN for Microsoft's Speech SDK (free to download) ..
Once installed you can embed speech into your vb.net applications ...
Regards,
GaryW
|
|
|
|
|
there any guide to implementing, or is there documentation with the SDK on implementing it? thanks
|
|
|
|
|
Yes .. there's a pretty comprehesive help file with the SDK ...
GaryW
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SpFlags As SpeechLib.SpeechVoiceSpeakFlags = SpeechLib.SpeechVoiceSpeakFlags.SVSFlagsAsync
Dim Voice As SpeechLib.SpVoice = New SpeechLib.SpVoiceClass
' Speak introduction
Voice.Speak("Hello")
Voice.Speak(Me.TextBox1.Text)
and add references Interop.SpeechLib
there is a site coding4fun where i found out about this one hope this helps
|
|
|
|
|
This example is for getting an app to talk, not to get it to do recognition.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
yeah im trying to get the recognition not speaking, ty though, probably will come in handy in the future
|
|
|
|
|
in c++ we used break statement to get out of the CASE loop
is there any similar thing in vb.net,,,
i hav tried break,, but it wont work
|
|
|
|
|
Exit Select
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i m using multiple group boxes n multiple check boxes within them..
i hav made columns in data grid acc. to the name of group boxes,
can anybody please tell me how can i show the text that i checked in the group box in the data grid with comma's b\w them
please help
|
|
|
|
|
Please help me
i want to run a music file from my system but the speaker which is connected to the other system using network.
How to access the sound port in the other systems?
Md Shihab
|
|
|
|
|
You'll have to write two applications, one for each machine. The first, a client app, will have to take the music from a source and send it to the other application on the other machine over TCP or UDP. This other machine will be running a server application that the client talks to. It will have to accept that data and play it, probably using either Media Player or DirectSound.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hello,
At the moment I'm developping a stock management system for where I work. Its working through a local network in the company. there is a "server" that handles user connections, a database etc (coded in vb (they gave my vb.net 2005 to code with)) it can handle mutliple connections etc.
Recently I started working on the client that should turn on computer inside the company I did a quick preview at the company recently and well they came with the idea of implementing a same system on PDA's, pocketPc's. So here is a bit my problem I'm dealing with and have no clue of how dealing with it.
The pocketPC will have their version but wont have constant access to the database so will have a temporary database on the system. when they are in the company they plug the pda to a computer though bluetooth, infrared or those dockingsystems and get should get access with a TCPClient (like the normal clients to right now) now some of the users of the pocketPC's wont be in the company the whole day but will be going to customers and well the idea would be that when being there with a simple computer connected to the internet or the pocketpc connected itself to the internet (not sure this is possible?) they can connect too the server and transmit and gather info from the server...
I tried a couple of things but it didnt work. For exemple for the normal client I created a "chat" kinda thing just to test the server. So I tried to pass a B (82.x.x.x) class IpAdress to the server and TCPClient but it wont convert it to an actual IP it will only take Class C address (192.x.x.x) so even with a normal chat system I cant seem to connect through the internet to the server. It will only work on a local network....
so is there a way to combine both? a local and internet connection to the server? adn especially is it possible to implement something like that on a pda?
Thanks already for all the help,
Kind regards
Jozef
|
|
|
|
|
It's possibel to do. The PDA would have to be assigned a valid IP address wherever it was plugged into the network. You can't just give it any old IP addres and expect it to work.
The server would also have to be visible on the Internet (not exactly a secure environment!!). Whether that's done by directly exposing the server on the Internet or having a firewall translate between the servers internal IP and port and your external IP address, well that's up to your IT department.
Your PDA client really should care what it's own IP address is. All it should care about is the servers IP address and port number.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|