Jump to content
xisto Community
Sign in to follow this  
rejected

Visual Basic 6.0 Help Needed Adding lines to a textbox without delete

Recommended Posts

VB6 Text Book Control

 

Visual Basic 6.0 Help Needed

I have a text box and it's Multiple line option is enabled.

The Text books contains the following text

"This is normal"

"This is Bold"

"This is Italic"

I would be grateful if you kindly let me reply to get the desired results as mentioned.

 

Thanks

C

 

-question by Jayanta Bardalai


With standard TextBox you can't have multiple fnt styles... If you want that, then use RichTextBox control, that allows multuple font styles, colors and others...

Share this post


Link to post
Share on other sites

My dear friend it is very easy to add text lines to a text box keeping the existing line intact.?For example:You have two variables a and band a text box named text1a = “Visual Basic ”b = “ Is a programming language”If we code as?text1.text = a---then text1 which show Visual Basic, if we want to add the second line that is the value of variable b to the current text then the following code is applicabletext1.text = text1.text & bor?text1.text = a & bboth the coding gives the same results that is?Visual Basic Is a programming language

Share this post


Link to post
Share on other sites
Re: VB6 Text Book ControlVisual Basic 6.0 Help Needed

Hello, Jayanta Bardalai.See: RTF (Rich Text Formatting) Text Box Controls (RICHTX32.OCX) to achieve this.For instance, a function I made for RTF boxes that works for inputting different colours:

 

Public Function OutputToScreen(ByRef strOutput As String, Optional ByRef lngColour As Long = &HC0C0C0, Optional ByRef bytAmountEnters As Byte = 0)With frmMain.RtbScreen .SelStart = Len(.Text) .SelColor = lngColour .SelText = String(bytAmountEnters, Asc(vbCrLf)) & strOutputEnd WithEnd Function

 

You may have to alter the code slightly to adjust to your desires.-Donkano

-reply by Donkano

Share this post


Link to post
Share on other sites
You roxx baby...........Visual Basic 6.0 Help Needed

Replying to EikonI just wanna say, that because of you I have got 48/50 marks in vb...I just wanna thank you a lot... I bless God that u get everything you want in lyf...THAAAAANXXXX

-feedback by Swapnil Godse

 

Share this post


Link to post
Share on other sites

I need a help how to connect sql2000 to vb6.0


Option ExplicitDim myDB As ADODB.ConnectionDim rs As ADODB.RecordsetPrivate Sub cmdLogIn_Click()Dim rs As ADODB.Recordset' Set rs = New ADODB.Recordset' rs.Open "Select UserName, Password FROM userinfo", myDB, adOpenStatic, adLockReadOnlyIf txtUsername.Text = "" Or txtPass.Text = "" ThenMsgBox "You must fill in UserName or Password", vbCritical, "ERROR"txtUsername.SetFocusExit SubEnd IfDo While Not rs.EOF' If UCase(txtUsername.Text) = UCase(rs.Fields!UserName) And UCase(txtPass.Text) = UCase(rs.Fields!Password) ThenIf (UCase(txtUsername.Text) = UCase(rs.Fields!UserName)) And (UCase(txtPass.Text) = UCase(rs.Fields!Password)) ThenMsgBox "You are Now LogIn"frmMain.ShowfrmLogIn.Visible = FalsefrmMainFrame.Visible = FalseElseMsgBox "Wrong Input"frmLogIn.ShowEnd IfExit Subrs.MoveNextLoopEnd Sub'Set myDB = New ADODB.Connection ' to connect to sqlserver' myDB.ConnectionString = "Provider=SQLOLEDB;Server=" & "STI-46901090D95" & ";Initial Catalog=" & ";UID=" & "sa" & ";PWD=" & "sti" & ""' myDB.Open "DSN=STIBAKE" ' master is database name'Set rs = New ADODB.Recordset'rs.Open "Select UserName, Password FROM userinfo", myDB, adOpenStatic, adLockReadOnly'On Error Resume Next'Set Connstr = New Connection'Connstr.ConnectionString = "Provider=SQLOLEDB;Server=" & "STI-46901090D95" & ";Initial Catalog=" & "STIBAKE" & ";UID=" & "sa" & ";PWD=" & "sti" & ""'Connstr.Open' Dim rs As Recordset' Set rs = New Recordset'rs.Open "Select UserName,Password FROM userinfo", Connstr, adOpenStatic, adLockOptimistic' Dim rs As ADODB.Recordset' Set rs = New ADODB.Recordset' rs.Open "Select UserName, Password FROM userinfo", Connstr, adOpenStatic, adLockReadOnly'End SubPrivate Sub Form_Load()On Error Resume NextSet myDB = New ADODB.ConnectionmyDB.Open "PROVIDER = Microsoft.Jet.OLEDB.4.0;Data Source =" & App.Path & "\db1.mdb;"Set rs = New ADODB.Recordsetrs.Open "SELECT * FROM TABLE1", myDB, adOpenStatic, adLockOptimisticEnd Sub

Share this post


Link to post
Share on other sites
Files in vb6Visual Basic 6.0 Help Needed

Greetings!How to read multiline text file and how to display those lines into combo/list box?

Details:Say,a file "ProjectList.Txt" contains list of projects...Just I wan a read those names of project and wan a display those into combo...So that I can select any one of them for further process...

Thank you...

-reply by teju

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.