- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在 Visual Basic 2008 中将 MessageBox 中的字体设置为粗体?
我希望它是这样的:
MsgBox(Documentation: .........)
“文档”将以粗体显示。
最佳答案
正如 aphoria 所说,VB 的 MsgBox 不允许粗体文本。以下是解决此问题的方法:
1) 添加“新 Windows 窗体”2) 添加一个富文本框3)添加你想要/需要的命令按钮的数量4) 转到表单代码并执行如下操作
Public Sub CustomMessageBox(ByVal msg As String, ByVal isBold As Boolean, ByVal color As System.Drawing.Color, ByVal buttonOneText As String, ByVal buttonTwoText As String, ByVal startBoldAt As Integer = 0, ByVal endBoldAt As Integer = 0)
' Use parameters to pass the values you want to show
' startBoldAt will be the position in the string where you want to have bold lettering begin, and endBoldAt will be the position in the string where you want bold lettering to end.
End Sub
Then you can do:
Dim cmb as CustomMessageBox = New CustomMessageBox('Your parameters)
' Add a sub that will let you show the CustomMessageBox
cmb.Show()
希望对您有所帮助。
关于vb.net - Visual Basic 中 MsgBox 的粗体字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14840843/
我正在尝试编写 VBScript,并且正在使用 Randomize 和 MsgBox 等函数。我很好奇使用 () 和不使用它们有什么区别。例如: 随机化 - 此行有效。 Randomize() - 此
哪种方法更好以及为什么。 最佳答案 不要使用是/否问题,而是使用带有自定义按钮的问题: The file blah.txt has been modified. Would you like to s
我想要一个工作表更改宏,只要将大于 8 的值放入范围 (F14:J26) 中的单元格之一,并且将大于 300 的值放入单元格 C37 中,该宏就会弹出一个消息框。 我的问题是单元格 C37 不是手动填
我有一个 VBA 脚本,内容如下: 1,选择特定工作表时将运行 2、判断条件是否为真 3、如果有,显示MsgBox Private Sub Worksheet_Activate() Dim curre
我有一组可以删除的形状。 但是,如果其中至少一个被删除,那么我会收到一个错误,即找不到指定名称下的对象。 基本上我想发表评论,告诉我所有的形状都已经被删除了。 到目前为止,我的代码如下所示: Sub
在我的 VBA 项目中,我偶尔会弹出 MsgBox 以通知用户在子例程运行后某些内容已“完成”或“更新”。 如果没有 MsgBox,它似乎运行良好,但插入一个似乎给我一个错误。 不确定是否有必要在此处
当我在他的 post about using SQL in Excel 中看到这个时,我正在查看 Chandoo 优秀网站上的一个代码示例。 : MsgBox "I was not able to f
我有一个显示在 msgBox 中的数组通过 Join()功能。如果我使用 Join,我想知道如何删除出现的尾随逗号在 resultsFinal大批。 Function test2(Var As Ran
是否可以使此代码的 msgbox 仅出现一次?我的问题是,如果用户插入数据,即从第 501 行到第 510 行,消息框将出现 9 次,我只想拥有一次。这样做的原因是因为代码在每个单元格中查找以验证是否
我有一个有趣的问题 - 我正在尝试编写 VBA 代码,它将获取单元格的内容并将其放入 msgbox。问题是我不知道如何将回车符放入这个字符串中。 我的代码看起来像这样。 Dim myMsg as st
有宏观问题。 VBA初学者。有以下情况: Column D Column E 3 2 我只是想确保用户没有在 D 列中输入任何超过 E 列的内容。如果是这样,则会弹出一个消息
我正在编写一个宏,它比较两组值并警告用户是否存在任何差异。当发现差异时,我希望用户输入他们的评论。为了让他们更容易理解我在问什么,我想在我用来获取评论的 InputBox 中显示所有数字。我想获得的示
我想知道是否有人可以帮助我将下面的内容变成一个消息框。基本上我希望它首先检查以下范围是否有 查看 如果他们这样做,则会出现一个 msgbox,解释违反了哪条规则。我曾尝试创建变量,但不确定如何在 ms
我有以下设置来复制列表并粘贴到工作表(数据)。我希望它在成功时显示一条消息,告诉我它是从哪一行开始粘贴的。但是,errmsg 反而显示。 提前致谢 Dim current As String
我正在尝试编写一个使用 的 vbscript谷歌演讲 到消息的发音。 我必须使用 将代码保存到 Notepad++ 无 BOM 的 UTF8 编码 并且发音不错,但是消息框的显示对重音字符不好。 如何
我正在尝试创建一个代码,如果 G 列单元格中的内容不等于 0,则显示 MsgBox。代码仅适用于一个单元格,但不适用于整个范围 (G20:G100)。你能帮忙吗?谢谢 Private Sub Work
我的数据如下。 更新问题 Sub Solution() Dim shData As Worksheet Set shData = Sheets("Sheet1") 'or other r
我希望每次单元格包含特定文本时都会显示一条弹出消息。每当“红色级别”一词出现在任何一个单元格(I22、I23、I34、I35、I36)中时,我希望出现一个 MsgBox。我在上述所有单元格中使用数据验
这会导致语法错误: Sub test() MsgBox("hello world", vbOKCancel) ' syntax error at this line Exit Sub
我正在尝试编写一个快速的小宏,要求用户输入,然后将其复制到特定单元格(Sheet1 中的 B14)。这是我到目前为止所得到的: Option Explicit Sub updatesheet()
我是一名优秀的程序员,十分优秀!