|
The horizontal scroll bar appear only when you set muti-line to false. But it won't show the vertical scroll bar wether you set Scroll bar to "3-rtfboth".
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
Komsot man from SCN-CO wrote:
The horizontal scroll bar appear only when you set muti-line to false
This is not true. You can have a multi-line RTB with lines that extend beyond the limit of the control, thereby showing the horizontal scroll bar. The MultiLine property doesn't disable any of the scrollbars.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I mean in vb6. Not vb.net.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
According to the docs, still not true.
From the VB6 RichTextBox docs:
Remarks
For a RichTextBox control with setting 1 (Horizontal), 2 (Vertical), or 3 (Both), you must set the MultiLine property to True.
At run time, the Microsoft Windows operating environment automatically implements a standard keyboard interface to allow...
And from the VB6 MultiLine (RTB Control) docs:
Remarks
A multiple-line RichTextBox control wraps text as the user types text extending beyond the text box.
You can also add scroll bars to a larger RichTextBox control using the ScrollBars property. If no HScrollBar control (horizontal scroll bar) is specified, the text in a multiple-line RichTextBox automatically wraps.
[EDIT]
Oooppss! I forget to put in here, that you can change the RightMargin property so it sits outside the visible boundries of the RTB control to get the scroll bar to appear when multiline text goes outside the visible boundries of the control.
From the VB6 ScrollBars property of the RichTextBox control:
A horizontal scrollbar will appear only when the RightMargin property is set to a value that is larger than the width of the control. (The value can also be equal to, or slightly smaller than the width of the control.)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I wrote a small program, that accesses a database to pull information. My problem is that I am not working on the program at the install location, and the file needed resides on a network share at the location. How can I code the program to use the file that I need it to? I can send the code if needed for what I have done so far, and any help would be greatly appriciated.
|
|
|
|
|
I would have to see the code really, and then i still might not be able to help.
cheers
|
|
|
|
|
Here is a snipit of the code. I can e-mail the source file to you if you supply me with an e-mail address. Also, when looking at the code, it is fairly simple. Most of the work is done with an (odbdataadapter).
Public Class frmUPS
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Friend WithEvents txtOENum As System.Windows.Forms.TextBox
Friend WithEvents btnExecute As System.Windows.Forms.Button
Friend WithEvents lblOENum As System.Windows.Forms.Label
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents Dsups1 As UPS.dsups
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmUPS))
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.txtOENum = New System.Windows.Forms.TextBox
Me.btnExecute = New System.Windows.Forms.Button
Me.lblOENum = New System.Windows.Forms.Label
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.Dsups1 = New UPS.dsups
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Dsups1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'OleDbDataAdapter1
'
Me.OleDbDataAdapter1.SelectCommand = Me.OleDbSelectCommand1
Me.OleDbDataAdapter1.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "calPackage", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("Sm_referenceText0", "Sm_referenceText0"), New System.Data.Common.DataColumnMapping("Sm_trackingNo", "Sm_trackingNo")})})
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT Sm_referenceText0, Sm_trackingNo, m_foreignKey FROM calPackage WHERE (m_is" & _
"PkgVoid = 0) AND (Sm_referenceText0 = ?) ORDER BY m_foreignKey DESC"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
Me.OleDbSelectCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Sm_referenceText0", System.Data.OleDb.OleDbType.VarWChar, 35, "Sm_referenceText0"))
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
"ocking Mode=0;Jet OLEDB:Database Password=;Data Source=""C:\upsdb.mdb"";Password=;" & _
"Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=""Microsoft" & _
".Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properti" & _
"es=;Mode=Read;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=" & _
"False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Rep" & _
"lica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"
'
'txtOENum
'
Me.txtOENum.Location = New System.Drawing.Point(172, 40)
Me.txtOENum.Name = "txtOENum"
Me.txtOENum.Size = New System.Drawing.Size(96, 20)
Me.txtOENum.TabIndex = 0
Me.txtOENum.Text = "Order Number"
'
'btnExecute
'
Me.btnExecute.Location = New System.Drawing.Point(184, 280)
Me.btnExecute.Name = "btnExecute"
Me.btnExecute.Size = New System.Drawing.Size(72, 24)
Me.btnExecute.TabIndex = 1
Me.btnExecute.Text = "E&xecute"
'
'lblOENum
'
Me.lblOENum.Location = New System.Drawing.Point(172, 16)
Me.lblOENum.Name = "lblOENum"
Me.lblOENum.Size = New System.Drawing.Size(96, 16)
Me.lblOENum.TabIndex = 3
Me.lblOENum.Text = "Order Number"
'
'DataGrid1
'
Me.DataGrid1.DataMember = ""
Me.DataGrid1.DataSource = Me.Dsups1.calPackage
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(16, 88)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.PreferredColumnWidth = 125
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.Size = New System.Drawing.Size(416, 184)
Me.DataGrid1.TabIndex = 4
'
'Dsups1
'
Me.Dsups1.DataSetName = "dsups"
Me.Dsups1.Locale = New System.Globalization.CultureInfo("en-US")
'
'frmUPS
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(440, 318)
Me.Controls.Add(Me.DataGrid1)
Me.Controls.Add(Me.lblOENum)
Me.Controls.Add(Me.btnExecute)
Me.Controls.Add(Me.txtOENum)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "frmUPS"
Me.Text = "UPS Tracking # Retreiver"
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Dsups1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnExecute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExecute.Click
' The following line passes the value the user enters for the OE Number.
OleDbDataAdapter1.SelectCommand.Parameters("Sm_referenceText0").Value = txtOENum.Text
Dsups1.Clear()
OleDbDataAdapter1.Fill(Dsups1)
End Sub
End Class
|
|
|
|
|
Do you mean the database file you store on the network? I used to do with this problem too. I used to write some small application for learning purpose only. When I run my program and take any record to show on the form, I have to choose a database file (usually ms access) from Open commondialog control. Then it return the path to access this database. So my mdb file could locate any where on the hard drive.
For the file on the network, you need to share a folder from the other computer and map a network drive on your computer. Make sure that the permission on the other computer set to read and write for your PC. Then you can view and add/update/delete your record to your database. Otherwise, you could view only.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I am making a small data logging program using VB6. As the data points were logged, I wanted to display them on the form. As the richtext control has save, load and print to printer methods and also some formatting options, I thought I will use it. More over I plan to show a small graph from the data, on to the richtext control.
But as I started using it, I discovered that I can not add data line by line the way say I can send lines of data to picture control. Does any body know how to add data to Richtext control line by line?
So I tried the lousy
SomeRtxt.TextRTF= "1stLineDat" & vbcrlf
SomeRtxt.TextRTF=SomeRtxt.TextRTF & " 2ndLineData"
But it does not work properly. I have this control on picture control of an MDI Form.
Above code ends up showing only the first line.
Or am I doomed to first write to a file and then keep loading it to richtext control as line by line data is added?
Can anyone lemme know how to add line by line text to a richtext control?
YK Prakash
ykprakash@hotmail.com
|
|
|
|
|
Read the class documentation for the RichTextBox[^] class. You'll find that is has an AppendText method that does exactly what you looking for. You'll also find the ScrollToCaretMethod which will scroll the RTB to the position of the insertion caret.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thakks a lot for your advice.
I was able to solve the problem by using .selrtf method.
I will try the appendtext method.
YKP
|
|
|
|
|
Anybody here know how to create a directory with spaces? Just like "C:\something\something more"?
|
|
|
|
|
MkDir "C:\something\something more"
However the folder something would have to exist.
So it would be
MkDir "C:\something"
MkDir "C:\something\something more"
if both didn't exist
It's so true.
|
|
|
|
|
You could also use api functions
http://www.mentalis.org/apilist/CreateDirectoryEx.shtml
http://www.mentalis.org/apilist/CreateDirectory.shtml
Again you have to create the dirs in steps.
It's so True.
|
|
|
|
|
You mean somthing like this?
Imports System.IO
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Directory.CreateDirectory("C:\something\something more")
End Sub
|
|
|
|
|
Hi
We are currently experiencing problems with VB.NET using large ammounts of custom controls. Occasionally when we open our forms in the design view of Visual Studio 2003 one of two things will happen - the forms just drop all of thier controls off of the forms, or, the controls drop all thier handles!
Has anyone experienced anything like this before, and if so did you find a solution?
Thanks
Michael
|
|
|
|
|
You'll have to supply more information about the problem in order to diagnose it. But, I have run into this[^] problem before. There's a hotfix available for it now.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dear All...
How can i implement the "Print to file" functionality using VB?
____________________________________________________________
rishabhs
I think therefore I am.
|
|
|
|
|
You'll have to write the code to output whatever you want to this file yourself using standard file write methods. The "Print To File" functionality in both the .NET Framework 1.0 and 1.1 is broken. This is supposed to be fixed in 2.0 though.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello I am using RTB in VB.net, i am developing a text editor. I am facing a problem that is, when I copy text from a word document that contains tables as well and paste it into RTB. it ruin the structure of table. means if table in word document was containing 3 rows and 2 columns it makes just one row and moves text out of the table. Along with it does not apply same fonts (a document can have multiple fonts and their sizes ), rather it applies default font....
can u guide me about it.....
Thankss
|
|
|
|
|
Hi,
I've a little console application in vb.net.
I want when the program exit, to test an errorlevel to know if the program run well.
I've search around but I've found nothing about how to do that.
Any1 know how to generate errorlevel code on a console application exit ?
thx
Sybux
|
|
|
|
|
The return value from the Main method returns the errorlevel back to the command prompt
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
I've try 2 methods but all failed.
1st one : I've added a system.environment.exit(myfunction)
In "myFunction", I return 1, 2 or 3 as exit value.
Problem : errorlevel is always 1
2nd one : I've modified the sub Main in function Main() as integer and replaced the system.env... by return (myFunction)
And the problem is still the same only an errorlevel 1 is generated.
|
|
|
|
|
I created a little demo program. My suggestion of returning the value from the Main method doesn't seem to be available in VB.NET (It must be a C# thing)
Anyway this works:
Module Module1
Sub Main()
Environment.Exit(Convert.ToInt32(Environment.GetCommandLineArgs.GetValue(1)))
End Sub
End Module
It takes a commandline parameter which it returns back as the error code. The following little batch file demonstrates:
SetErrorLevel 5
echo The error level is %errorlevel%
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
I've created a service that updates the components of several of my applications from a central file share on my network. The service is running with the localsystem account. An exception occurs when the service attempts to connect to the file share. The share contains the components that I copy to the local computer to update an application. I think the problem lies in the way the service connects to the shared folder. It uses the local computer's credentials when it connects, I think. Is there any way that the service can connect to the specified file share using the current user's credentials?
|
|
|
|