Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Textbox Differnt Font For Differnt Line


Hi guysi don't know if this is possible and if so i cant seem to find how but i have a db record set i want to display in a kind of report format like in access you have the ability to create a report nothing fancy.well i have got as far as being able to load the record set into a text box that i will use as a viewer(unless some thing better is suggested) but i was wondering if there is any way to set the font of a line different to the next line so that i may have maybe bold descriptions and then normal data?db is sql server 2005 not that it should mater in this casethanks in advance




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Differnt OS For Same App
I've been asked to write a small database for friends company.  The have some PC's on Win98 up to XP pro.  What are some things I need to think about up front when writing the code to accomadate the range of OS's that will be incountered.

I will be coding on an W2K box.  Should I try to find a Win 98 box for the purpose of writing this?  Thanks for the input. I tried to have patience but it took to long!   -DW

Using VB To Run A Differnt Program.
My father has taken VB in college and I picked up the book and have started playing with it. I have created someof the programs in the book and I have just started to create my very own program. As my father and I have started talking about it I had to go to work. He decided to try to help me out and look some coding. As hee looked he could not find any help anywhere.

Now to my question. Is it possible to start another program with a program writen in Visual Basic?

Thank you,
-gamesfreke

MS Acess Help - 3 Differnt Questions
hi - this is my second attempt to ask thius question so i hope i can get it across - this isnt actually urgent yet (due wed) but i mgiht have to split this ito 3 seperate posts to try and get more views/help - though not unless you guys help me here

1) Ok i have a "Meeting" table in access, my employees attend meetings thats have a duration of 1, 3, 5 or 7 hours
the fields in my table are "Start Time" (time), "End Time" (time)and "Duration" (number)
what i want to be able to do is somehow validate that the end time - the start time will = the duration - the problem i have is a time minus a time gives another time and my duration is a number - is there a simple way to do this?

2) The "meeting" table contains the start and end tiome of a meeting, so when the user programs in a meeting - i need to be able to somehow search both the "Start Time" and "End Time" colums to makes sure that the employees isnt already in a meeting - is there a way i can do this?

3) I a differnt table i have a field that is "Yes/No" and a checkbox
What i was woundering how to do is - is it possible to write an SQL statement to check the value of the checkbox for a specific record?


Thanks alot for the help

Differnt Between Hide And Visible
what is the differnt between frm.Hide and frm.Visible.

Differnt Types Of Beeps In Vb6
hello

Is there any function in vb6

which give different types of beep

without external speakers...(multimidia speakers)

like in case of qbasic

full syntax

thanks

Two Differnt Questions Need To Be Answred Please
would any body please anwser my two questions

1-on which the speed of downloading a file from internet depends on and how i can control the speed as in download programs

2-how can i issue sound when i press a key on the keyboard while i'm writing in the microsoft word for instance



thank you in advance

Sending Mail From Differnt Accounts
Plz tell me some code by which I can specify which account to be used in outlook other than the default account while sending the mail

Sending Mail Using VB But From Differnt Accounts
Hello
I have multiple pop3 accounts in outlook xp. One of them is default which is normal feature. I want to send a mail using VB but everytime it sends, it uses the default account. How can I use different accounts for different mails without changing the default settings manually in Outlook. Also how can I insert the receipent address from existing record in contact.
Regards
Azam

MSCOMM Control Acts Differnt On 2k Then 98
   I have a program which uses the MSCOMM control to send a string to a com port. On the other end of the port is a label printer. These thing is pretty "dumb" as far as hardware goes and just reads a text string. (Am I the only one one who hates these things? Using Windows Drivers for them is only slightly faster then drying paint and they don't support very basic functions like printing more then one page at a time... to get around this a person must send a text string formatted using a special "Language". These things need to come out of the stone age IMHO.) The code I'm using is pretty simple, but works fine on Windows 2000.


Dim MyString as String

   MSComm1.CommPort = 1
   
   MSComm1.Settings = "9600,N,8,1"
   
   MSComm1.PortOpen = True
  
   'I determine the value of MyString Here

   MSComm1.Output = MyString

   MSComm1.PortOpen = False

Now when I use the same program on a machine running Windows 98, I get nothing. No error, no lockup, just nothing. I've tried on multiple machines and gotten the same result.

On windows 98 I can go to a command prompt and type:

MODE Com1 Baud=9600, parity=N data=8 stop=1
COPY MyText.txt COM1
and the file prints out fine, so I don't think there is anything wrong physically with the computer.

Anyone have any ideas?
   


"It sounded like a good idea at the time.."

Almost Done, Cant Plot 2 Differnt Lines On Same Graph
THis code wotks, but it will only plot one line. If I comment out either for statement, I will get a line. The tricky thing is that they are both identical (theory vs experimental type of thing) so I want one to be a line (no marker) and the other to be markers only (no line). The problem is that one will overwrite the other..help.

Option Explicit


Private Sub Form_Load()
Dim dx, Number As Double
Dim i As Integer
Const x_max = 0.5
Const Q = 1
Const A_0 = 1
Const A_p = 1
Const k = 1
Const n = 4
Const T_0 = 1
dx = x_max / (n - 1)
ReDim Tn(1 To n, 0 To 1), T(1 To 10, 0 To 1) As Single
Dim xn(1 To n, 0), x(1 To 10, 0) As Single


'setup initial variables
xn(1, 0) = 0
Tn(1, 0) = CStr(xn(1, 0))
Tn(1, 1) = T_0

'Solves for consecutive values of the function
For i = 2 To n
xn(i, 0) = xn(i - 1, 0) + dx
Tn(i, 0) = CStr(xn(i, 0))
Tn(i, 1) = Tn(i - 1, 1) - Q * dx / ((A_0 - A_p * dx * (i - 1.5)) * k)
Next i

'Plot data (only markers, no line)
With MSChart1
.ChartData = Tn
.chartType = VtChChartType2dXY 'default is scatter with solid line
.TitleText = "Solution"
.Plot.Axis(VtChAxisIdX).AxisTitle.Text = "Position X"
.Plot.Axis(VtChAxisIdY).AxisTitle.Text = "Temperature T"
.Plot.SeriesCollection(1).Pen.VtColor.Red = True
.Plot.SeriesCollection(1).Pen.Style = VtPenStyleNull 'if I want to remove line
.Plot.SeriesCollection(1).SeriesMarker.Show = True 'Marker only
End With

'Now, lets plot the exact solution (line only, no markers)
For i = 1 To 10
x(i, 0) = x_max * (i - 1) / 9
T(i, 0) = CStr(x(i, 0))
Number = (1 - (A_p / A_0) * x(i, 0))
T(i, 1) = T_0 + (Q / (k * A_p)) * Log(Number)
Next i

'Lets plot this line

With MSChart1
.ChartData = T
.chartType = VtChChartType2dXY
.Plot.SeriesCollection(1).Pen.VtColor.Blue = True
'.Plot.SeriesCollection(1).SeriesMarker.Show = False 'This removes marker, but I cant use it until I figure the code out
End With


End Sub

Array Of Multiple Differnt Control Types
Well the title says what I'm trying todo (though I'm not convinced its possible) I'll try to elaborate a little bit. I'm basically adding differnt controls at runtime (using a hidden control, and the Load command). I'm trying to make all of these items appear in a single column down the middle of the page, and also have the ability to delete an item and thus move the other objects into place.

Take a look at my test project... form1 is basically the idea, but using a single control, I'm trying to acheive the same functionality but with multiple controls.

Form2 is my start at an attempt (yes I know they are both textboxes, I thought I'd start with that then move onto multiple types if poss.)

Compare Between Two Lines From Two Differnt Text File
hi every one

i have text file and it updated every day and i want to copy first line from this file and pasted in new text file to compare between the first line in both text file
what is the code can i use to do this

thank you .

Hi I Need Some Helping Telling A Pointer To Get A Varible From A Differnt Process
Hi i am hacking Battlefield 2142 to give myself unlimited ammo and i need some help.Ok so the way i am going to do this is get the address of a "pointer" that sends me to the variable for Clip size. I am programing this in Visual Basic 6.0 and i need some help coding it. So far i don't have any code, all i have is the pointer address. I Don't know how to tell the pointer that it needs to look under the process name of "bf2142.exe" Once i have the code to tell the pointer to look in that directory it will be pretty easy, an if and then statement but the problem is finding the variable for clip size. first I need some help with the coding part, if anyone can list an example and how to do this it would be much appreciated.

Anyone Know How To Make The Sound API Let Me Play Differnt Sounds At The Same Time?
or maybe another sound API that will let me do this, this is crucial in my virtual drum set program

Form Size On Differnt Size Monitor
Hi all
I am having a problem with an assignment.The problem is that when i put my assignment from my home computer ("17" monitor)on my college computers ("14" monitors) there are parts of my forms missing.The forms wont fit on the screen.Is there anything i can do?
Need help with this badly!!
Thanks

Rich TextBox - Changing Font For A Specific Line Only
Hi! I have a long text on a Rich text box control, and i want to change the font for certain lines only. How can i do this without changing the entire textbox's font?

Thank you very much!

Prevent Multi Line Textbox From Wrapping Incomplete Words To The Following Line
Hi.

I've created a textbox that will mimic a mainframe screen that has a dimension of 80 X 24.

The following textbox properties are set as follows:
Multiline = True
Word wrap = True

When a user enters text into this textbox the text will wrap after every 80 characters, just like it would when typing on a mainframe screen.

PROBLEM: I would like the textbox to wrap only complete words to the next line...just like this forum textbox that I am typing into right now does..
would anyone know the code to accomplish this?

Thanks in advance..
marc

Ensuring Only 65 Chars Per Line In Multi Line Textbox
I have a text box that can have any number of lines, but each line can only have 65 characters (I'm using the SendMessage API). A blank space is treated the same as a character. Right now I'm adding a carriage return at every 66th character, which works fine if I don't go back and insert or change anything I already typed in. When I do try that the cursor gets put the end of all of the text in the text box. The only way to change any text is to back space to the point where I want to retype something.
I'm curious to know if anyone can give me some ideas about how I should go about doing this.
Thanks.

I'll post my code and you will see why I get pushed to the end of the text
Private Const EM_LINELENGTH = &HC1
charcount = SendMessage(txtDetails.hwnd, EM_LINELENGTH, txtDetails.SelStart, ByVal 0&)
txtDetails.Text = Left$(txtDetails.Text, InStrRev(txtDetails.Text, " ")) & vbCrLf & Mid$(txtDetails.Text, InStrRev(txtDetails.Text, " ") + 1)
txtDetails.SelStart = Len(txtDetails.Text)

Rich Textbox - Making A Given Line The Top Line Displayed
This is the short-and-sweet version of a question I posted earlier. Is there a way to make a given line in the rich textbox the first line displayed? (For example, if I want to display line #53 as the top line, is there a combination of methods/properties I can use to do this? I can't find any obvious technique.)

How To Force New Line Of Text In A Multi Line Textbox
For example, i want to print in vb like this

1. one
2. two

in c , i can do something like

printf("1. one
");
printf("2. two
");

If I need to display the same text in a VB textbox control, i must force a new line too. How could i do it in VB? Any help would be appreciated thanks in advance..

Check Every Line In Multi Line Textbox [resolved (already)]
hello again,

here i am with another problem, so i'll get straight to it.

i need to do the following code:

Code:If (Right(txtINPUT.Text, 1)) = ";" Then

for every line in a multi line textbox, as the code above just does the last character in the textbox. ive searched these forums and found nothing that is exactly what i want. ive found this but thats so much code, and im not sure if i could make that do what i want. there must be an easy way to do it, please let there be an easy way.

any help is very much appreciated.


Primary_Slave

----------------------------------------------------------------------------------------
I'm all wrapped up in my binary blanket and I'm coding on late into the night
----------------------------------------------------------------------------------------

Edited by - Primary_Slave on 10/12/2004 1:25:21 PM

How To Reveal Line Break For Perticuler Textbox In External Richtextbox/textbox?
Hi all could any one show me a method to identify the line break for perticuler richtextbox/textbox in external richtextbox/text. I am looking for things like this :<pbr>

I know all richtextbox/textboxes does not support that and some have thier own line break. could any one show me how to obtain that line break .thanks



class name info of rich edit :

RichEdit20A
#32770
AtlAxWin71
ATL:0053D798
WTL_SplitterWindow
WTL_SplitterWindow
WTL_SplitterWindow
My Window Class

Strip Down Textbox To A Line Then To Part Of The Line
Hi

i have the following in a multiline textbox:


Code:
Class: Static
hWnd: 852792
Text: [Win: ]
Class: Static
hWnd: 983772
Text: [Plrs:]
where it says "Win:" there is usally a % there, eg "Win:34%". i need to get the number "34" to textbox2.

how can i make it seach that line, and then take out all apart from the number?

thankyou!

Count #line In Multi-line Textbox
Hi,
any way or method to get number of line contain in the multi-line text box? I will print the content contain in multiline text box to printer. for this purpose i would like to count how many line will be printed so that if number of line is excess certain value, the program will eject and print to new pages.

Thanks

Last Line Of Text In A Multi-line Textbox.
Hi! I've made this form with one multi-lline textbox which will show the process status in my application, which in this case is downloading records from a database. Anyway, everything works out fine including the progressbar. But what I want now is how to automatically scroll down to the last message displayed in the textbox. 'Coz what happens right now is that while new lines of text were added to the textbox, it doesn't go down to the last message added so you have to scroll down to the last message after the process has finished. Is ther any way to go to the last line of text displayed?

Reading Textbox Content Line By Line
Hi, i have a text file with encrypted content, i'm currently openning and decrypting all the text file into a textbox. Now, how can read the textbox line by line, similar to reading an external text file?

I know how to do it with an external text file, but that will require to decrypt the file in the user computer and that's exactly what i want to avoid.

Here is some code i used, but not what i currently need!!

Code:
Private Sub Process(FileName As String)
On Error GoTo errorHandler

Dim StringData As String
Dim nFreeFile As Long
Dim temp, strFileName
strFileName = ""
nFreeFile = FreeFile

FileName = App.path + "EncryptedText.Text
Open FileName For Input As #nFreeFile

Do While Not EOF(nFreeFile)
DoEvents
Line Input #nFreeFile, StringData

'A few lines of code here

Loop
Close #nFreeFile

Exit Sub

errorHandler:
MsgBox Err.Number & " " & Err.Description
End Sub


I'll appreciate any help!! thanks
2005

How To Prevent Next Line In Multi Line TextBox
How can i prevent Next Line or CHR(13) in Multi Line Textbox when i press the Enter Key?

Because my client wants the Enter Key act as Tab Key... when i press enter it goes to next object... the problem is when i press enter key in multi line textbox it also create a CHR(13) in Textbox

I know this is not that important but i hope some of you have a good suggestion to help me satisfy my client.

How To Output Data Line By Line In To Textbox
Hi all. could any one tell me how to output to text box line by line. The current code putsa all the data after each other and it is unreadable.


VB Code:
For i = 0 To cm.Count - 1        'MsgBox cm(i) & vbCrLf & cm(i).SubMatches(0)        If i = cm.Count - 1 Then                    Text1.Text = Text1.Text & cm(i).SubMatches(0)        Else                   Text1.Text = Text1.Text & cm(i).SubMatches(0) & separator        End If    Next

Highlighting Text Line By Line Using Textbox
Hi guys , can any one tell me what shld i add to mine program so that when an event occur , it will highlight the 1st line and then the 2nd line till the last line .
Note :
1)each time , 1 line will be selected .
2)I am using a textbox

Code:

//api used

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SendMessageStr Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As String) As Long
Private Const EM_GETLINE = &HC4
Private Const EM_GETLINECOUNT = &HBA
Private Const EM_LINEINDEX = &HBB
Private Const EM_LINELENGTH = &HC1


Sub cmdsend_click()
lngCount = SendMessage(txtprog.hwnd, EM_GETLINECOUNT, 0, 0)

With txtprog
For i = 0 To lngCount - 1
lngLineIndex = SendMessage(.hwnd, EM_LINEINDEX, i, 0)
lngLength = SendMessage(.hwnd, EM_LINELENGTH, lngLineIndex, 0)
strBuffer = Space(lngLength)
Call SendMessageStr(.hwnd, EM_GETLINE, i, ByVal strBuffer)
Debug.Print "Line " & i + 1 & vbTab & strBuffer

Next
End With
End sub


Thanks in advance !

Reading Line By Line From A Multiline Textbox
Hi,
Is it possible to read from multiline textbox line by line.ie if textbox contains a value for eg Santh Thomas
     Nampiaparambil House
    Kaloor
then text1.text usually reads the enire value.I would like to read the value line by line ie
first santh thomas then Nampiaparambil House and then Kaloor, may be by using some kind of loop.Please help

santh

Reading A Textbox Line By Line And Then Saving It
I have a multiline textbox and I was wondering how to add something at the end of the line. I'm working on this program that would help me to create an html file, so I want it to add a "<br>" at the end of each line.
This is what I have so far:

Code:Dim strEntry As String

Dim i As Integer

Open "d:AngelJournal" & Date$ & ".txt" For Append As #1
    Write #1, txtEntry.Text & "<br>" 'Right now it's just adding the whole textbox. How do I do it so it goes line by line?
Close #1
End Sub

Same Line Different Font Type And Size
hi....

i'm trying to insert a line of text into words with differnt font type &
size.

for example the line below :-

My Name..................123456

'my name' will have font size 7, and '123456' will be size 10 and bold.

I would also like fill the gap between 'my name' and '123456' with '.......'
How do I estimate the number of '.' to fill?

please help me out.....I'm trying to do a directory program for my friend.
Thanks a lot....

DBList Font Change Per Line
Interesting little question...

I am populating a DBList box from an access database.

Each line that is entered refrences a batch file on a network drive. what I want to do is when I populate the DBList box I want it to verify that the batch file exists using the If FileExist command, My issue is that I don't know how to go one at a time through the list and check each item to ensure the Batch file exists. If the Batch file exists I want to Bold that line of the DBList, if not I want to leave the text alone.

Any thoughts?

Thanks,
Mike

Textbox Compare With Textbox Delimited Per Line
First of all, i loaded a txt file into a txtbox1 - numbers delimited by blanks in rows. There is another one txtbox2 whithin i type some numbers delimited by commas. I want to compare the numbers in txtbox2 with the numbers in txtbox1- line by line and get the common ones per line.
-whats the code for searching the txtbox1... line by line?
-whats the code for comparing (find commons) the values in txtbox2 with the ones in txtbox1 per line?
controls: commonDialog,2 txtboxes,cmdbutton,label that shows the commons
OR suggesting to read the txt file and seek the commons inside it while counting them by line?
See some code:
Open fileLoaded For Input As #1
txtContents.Text = Input(LOF(1), 1) ' i load the file into the txtbox by line

Do While Not EOF(1) ' Loop until end of file.
Line Input #1, numLine 'assign line of txt file into the var numLine

....????
thanks

Font Color Change With In Text Line
how to change font color with in textline of label text line in runtime. That is some words need to be highlighted with different font colors.
any help pl.

How To Change Font Size On A Single Line
I am using Vb6's standard print object and would like to know how to change the font size in a line of print.

I need to print "123 Welcome 123", on the first line of a page and would like the "123's" to be in a different font size than the "Welcome"

I have experimented with things like

printer.font.size = 20
printer.print Tab(2);"123";font.size=12; Tab(18);"Welcome"; font.size=20; Tab(40); "123"
printer.enddoc

The result is: 123False WelecomeFalse 123 all at size=20, but properly tabed.

I have looked at using the richtextbox also but the code for a WYSISWYG does not appear to be a simple undertaking.

TextBox Font
Here is my text box:

mlngText(0) = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", WS_VISIBLE Or WS_CHILD, 0, 100, 100, 20, _
mlngSetup, 0&, glngApp, 0&)

How do I change the font for the textbox? I am looking for bold options mainly but anything will help.

Is It Possible To Make A Listview Listsubitems Font Have A Line Or Strikethrough
Hi Guys,

Is this possible. If not, please advise me. I have a listview which list items from my database. If an item has a quantity of zero I make each listsubitem red to visually show it has a quantity of zero. Now the user wants to be able to write off an item. I can't make the listsubitems another colour cos what if it is written off and has a quantity of zero.

So I wanted to make the font have a strikethrough if the item is written off. But it appears that I can't

Line Count In 500+ Line Textbox
I have a line count function in a text box but when I get up to 500 to 600 lines I get an overflow when I try to lode the text from the beginning to the current position into a variable. I'm doing it by counting chr(13)'s from the beginning to the current cursor position. Can I trap this error so my app doesn't crash. I'm very unfamiliar with error handleing. Any help would be very appreciated. I think the error number is 6 but the following code does nothing:

Code:
if err.number = 6 then
exit function
end if
Checkline = mid(text1.text, 0, text1.selstart)

Textbox And Font Colors
How do I have different text in the same textbox different colors?

Example:

DodgeRida67: Hello

I would want Dodgerida67 is red and hello in black. Thanks.

Rich TextBox Font ???
Can anyone help me, I don't know how to use a rich text box. I only want to display text in different fonts, but I have no clue how???

Font In MultiLine TextBox
I have a multiline text box and was wondering if it is possible to change the font of one line within the box while having the font of the rest of the text box different. (i.e: Have line 1: Font size 12 and have line 2: font size 10).

Thanx

Textbox Font Properties
can the font properties like bold, italic, underline be made applicable to part of the text and not the whole text? i'm just refering to ordinary textbox not a richtextbox.

wish you all more VB power!!

Poke Textbox Font API?
Anyone have any ideas on how to set a textbox font to embolden some characters and leave some as normal, it's either really easy or really hard (and I can't make up my mind which at the moment... )


Thanks.

TextBox Color And Font
Hi All
I have a text in the TextBox, the text color is black and font size is 8.
How can I change the color and the font size only for one word or one letter in the text?

Thanks

Textbox Font Colour When Not Enabled
Hi folks,

Is it possible to change the colour of a textbox's font when the textbox is not enabled. (I do not want the colour to be light grey).

Thanks,
GJ

Setting Font Color In Textbox
what property would i use to set the font color in a textbox on a form? thanks!

Rich Textbox Font Color
I made a chat window for my chat program that when it loads up, it's
rich textbox color alway reverts back to black.

What the chat form does is when you click on the send button, the
message is sent and then the form is unloaded. I have public variables
in place to hold all the font properties. When the user sends a message
back, the chat form or message box loads back up, displaying the new
message. In the form load event, the font properties are reloaded with
the values already held in the public font variables and everything works
except for the font color.

My problem is that even if i have my font color set to red, when the form
loads back up, the rich textbox font color always goes back to black.

I've heard and experienced myself that the rich textbox has flaws in it.
For instance, if the font color is set to red and i change the font bold
property, the font color goes back to black.

I was just wondering if there is a way to subclass the rich textbox to
get it's font color property instead of the Selcolor property.

I noticed the rich textbox has font.bold, font.italic, font.underline and
font.size properties but not font.color. I wonder why?

Part Of Textbox In Bold Or Other Font
Hello,

Is it possible to put a part of a text in a textbox in another font or bold or something like that??

I have some sort of search possibility in my app and it would be nice to put the found part of text in another font or so (or something else but it must draw the attention).

Is this possible with a normal textbox?
If not, any ideas? Perhaps another control or so?

I'm using VB6.


Thanks!

Christophe

Copyright © 2005-08 www.BigResource.com, All rights reserved