在vb 6中的TextBox中使用缩进创建项目符号 [英] Creating Bullets with indent in TextBox in vb 6

查看:159
本文介绍了在vb 6中的TextBox中使用缩进创建项目符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VB 6.0的新手(来自.net)

我想创建一个带有项目符号的文本框并启用缩进功能.我知道我可以使用RTB控件实现此功能,

预先感谢

Hi I am new to VB 6.0 ( From .net)

I want to create a textbox with bullets and enable indenting too. I know i can achieve this using the RTB control<just by="" setting="" few="" properties="">, but i should achieve this using a textbox.Please provide assistance.

Thanks in advance

推荐答案

首先,VB6很烂,为什么要使用它?

您知道适合该工作的工具(RTB控件),但是想使用不支持您想要的控件的控件?除非找到包含项目符号的字体,否则文本框将无法执行您想要的操作.这就是为什么存在RTB控件的原因.
First of all, VB6 is crap, why are you using it ?

You know the right tool for the job ( a RTB control ), but instead want to use a control that doesn''t support what you want ? Unless you find a font that includes the bullet, a text box can''t do what you want. That''s why the RTB control exists.


信不信由你,我很快就会受命为VB6项目提供更新.我问他们是否要将其迁移到VB.NET或C#.

他们说不.因为他们在我的支票上签字,所以我说是老板.

根据OP的问题,您可以采取一些措施来模仿您的要求.

您可以添加一个制表符空间来缩进文本框. ASCII选项卡chr(9)并选择一个字符来表示项目符号.下面的示例使用一个星号,只需确保选择的符号是大多数PC上都可以使用的字体.

确保将文本框设置为多行.

Believe it or not, I will soon be tasked with providing an update to a VB6 project. I asked them if they want it to be migrated to VB.NET or C#.

They said no. Since they sign my checks, I say yes boss.

Per the OPs question, you can do something to mimic what you ask for.

You can add a tab space to indent the text box. ASCII tab chr(9) and choose an character to represent a bullet. The example below uses an asterisk, just make sure the symbol you chose is a font that is readily available on most PCs.

Assure that the textbox is set to multiline.

Private Sub cmdList_Click()
    Text1.Text = "This line is not indented." & vbCr & vbLf
    For i = 0 To 255
        Text1.Text = Text1.Text & Chr(9) & Chr(42) & " Line " & i & vbCr & vbLf
    Next
End Sub


这篇关于在vb 6中的TextBox中使用缩进创建项目符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆