|
Hi
I need to format a long string into user definable line lengths, i.e.
The cat sat on the mat and the dog bit the cat (linelength=10)
The cat
sat on the
mat and
the dog
bit the
cat
The cat sat on the mat and the dog bit the cat (linelength=11)
The cat sat
on the mat
and the dog
bit the cat
Can any of the regext gurus help me with this one? Note that a line ending can be a comma, semicolon, color, period.
Many thanks
Jeremy Holt
|
|
|
|
|
|
Ian
You're quite right, I don't know whay hadn't thought of that before.
I wrote this which seems to work:
Public Shared Function ToParagraph(ByVal Text As String, ByVal LineLength As Integer) As String
Dim arr As String() = Text.Split(New Char() {" "c})
Dim sb As New Text.StringBuilder
Dim CurrentLine As Integer = 0
For i As Integer = 0 To arr.Length - 1
If CurrentLine + arr(i).Length + 1 <= LineLength Then
CurrentLine += (arr(i).Length + 1)
sb.Append(arr(i) & " ")
Else
CurrentLine = arr(i).Length + 1
sb.Append(vbCrLf & arr(i) & " ")
End If
Next
Return sb.ToString.TrimEnd
End Function
Regards
Jeremy
|
|
|
|
|
|
Hi;
I hv C++ program which declare a return message as LPstr datatype, when i want to add reference this C++ program and used in VB.net & i receive this message in String datatype. After built, an Type mismatch error comes out.
Any one know how to convert LPstr datatype to any relevant datatype in VB.net
Headache Unmanaged Code
|
|
|
|
|
Has anyone done anything with an application that works with winfax or just windows fax?
|
|
|
|
|
I've got a HelpProvider control on my Project form with all the necessary Properties. If I run my project and press F1 on the form, it opens the correct Help file, but gives the following error:
"Index not yet installed"
What is the problem?
Pls F1!
|
|
|
|
|
i make program using java as server and vb as cliet. Client can get message from server but server can not get message from client..why...???
java code below
public testvb()
{
while(true)
{
Socket s=new Socket();
try
{
server=new ServerSocket(8888);
s=server.accept();
}
catch(Exception e)
{
}
try
{
in=s.getInputStream();
reader=new BufferedReader(new InputStreamReader(in));
out=s.getOutputStream();
writer=new PrintWriter(out);
System.out.println(reader.readLine());
}
catch(Exception e)
{
}
}
}
vb code below:
winsock.send "Sending message to server"
|
|
|
|
|
Hi all VB gurus, I'm a C++ person attempting to use the wizardry of VB for a quick DB app. I've used some DTPicker controls and want to compile the whole thing up in one exe, so I can run it any windows PC. Currently, it complains about a missing .ocx file if I run it on a machine without VB. Can't seem to find it any where in the project settings. Do I have to package it up like a dll using the Package and Deployment wizard or something? cheers all
|
|
|
|
|
Yes, you have to create a setup package that includes all the dependent files.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Thanks Ray, I thought I may have to. Have you check out my other post above? COuld really do with knowing if any other people have experienced the same problem?
Thanks Again,
Alan.
|
|
|
|
|
I need a program, like an installation wizard, to use with my program so that users can easily install the program.
Can someone tell me where can I get that?!
Thank you!
|
|
|
|
|
VB6 comes with the Package and Deployment Wizard that creates the Setup package for you. VB.NET comes with Setup Projects that can package the thing up for you.
RageInTheMachine9532
|
|
|
|
|
Use package and deployment wizard(you already have it with Visual studio)
or MS visual studio inastaller (free to download form microsoft site)
|
|
|
|
|
Hi!
Can someone tell me how to link to a webpage from a VB.Net program?
I designed the webpage in HoTMetaL.
Thanks!
|
|
|
|
|
This code shows a web browser window with CodeProject in it:
dim url as string = "http://www.codeproject.com/"
System.Diagnostics.Process.Start(url)
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I want to use 2 identical databases(with different data). I use a database component. I want to know how I can change the connection's path (change form 1 database to the other) so that I don't need to change all the adapters' connections.
|
|
|
|
|
<br />
DB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBPath + ";Mode=ReadWrite|Share Deny None;Persist Security Info=False"<br />
DB.RecordSource = SQL_QUERY<br />
DB.Refresh<br />
I'm using an ADO control to hook up to my DB, but I presume its quite similar with a DAO DB. Notice DBPath is a variable used to supply the path to the DB you want to switch to.
|
|
|
|
|
that smiley face has bloody appeared, NOTE it should be "Share Deny None; Persist...".
Alan.
|
|
|
|
|
Hello Everyone,
I was wondering if anyone can tell me how to close a main form from the second form. I know ME.Close() will close the current form. I actually want to exit the solution from the second form.
Thanks In Advance,
Tom
|
|
|
|
|
Hello
A simple answer is the form.unload command
Hope it helps!
didijoe
|
|
|
|
|
How can i rotate text in a label 90 degree( or label rotate 90 degree for horizontal text)?
MkhProgrammer
|
|
|
|
|
I'd like to know if ther is anybody who knows just how should I go about implementing my owb web browser application using winsokets. I want to create an application that would just connect to a web server. Then make a request for a web page that is located on the server and based upon the response from the server to make another request for another page.
I suppose I need to se winsokets on the port 80 but I don't know how to make the requests and get the responses and how to maintain the same connection throughout the whole process.
Miky
|
|
|
|
|
|
Hello everyone.
I've got a very small problem, for most of you this could be very stupid, but hey I'm new in the programming world.
I need to create a small program using VB 6.0 but I have a small problem with it.
Here it goes,
I have a form with a command button, when clicked is gonna open an inputbox asking for a value, but I need to say that if the value is less than 45 please display a word, if it's equal or greater than 45 but less than 60 display a different word, if it's equal or greater than 60 but less than 70 display another word and if it's equal or greater than 70 but less than 80 display other word.
I've got something like this in the code:
dim weight as single
weight = inputBox("Please type weight...")
If weight < 45 then
label.Caption = "reject"
Else
If weight >= 45 ... HERE IS WHERE I HAVE THE PROBLEM, i DON'T KNOW HOW TO WRITE THIS STATEMENT WITH the two values
label.Caption = "Small"
Else
If weigh ...the same ...
label.caption = "medium"
Else
(...)
End if
End if
End if
Please help me!!! thanks very much for any help
ASP.NET capo
|
|
|
|