富文本框中的图像和文本 [英] images and text in a rich text box

查看:119
本文介绍了富文本框中的图像和文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助.我创建了一些代码来搜索机器中的问题并将其报告给RTF文本框.它工作正常,但我想在文本旁边添加图像以显示其警告还是警告.请帮忙..

下面的代码是我用来查看是否存在问题的代码,如果出现问题,它将在服务停止时显示.这是在后台工作的人.我已经将需要的图片添加到资源文件中,只是我不知道如何在文本左侧显示它.


试试

MyObjSearcher =新System.Management.ManagementObjectSearcher(MyMgtScope.Path.ToString,_
选择*从Win32_Service WHERE名称=``remoteregistry''")

''执行查询
MyColl = MyObjSearcher.Get()

对于MyColl中的每个MyObj
昏暗的RemoteReg作为字符串

RemoteReg =(MyObj("state"))

如果RemoteReg ="Stopped"然后
RemoteRegistryService =远程注册表服务为"&RemoteReg&vbCrLf
如果结束
下一个



异常捕获

结束尝试

Need help. I have created some code to search a machine for issues and report what it is to a richtext box. It works fine but i want to add an image next to the text to show if its an alert or just a warning. Please help..

The Code below is what i use to see if there is an issue and if so it will display if that the service is stopped. This is in a back ground worker. I have added the pictures i need to my resource file i just dont know how to show it to the left of the text.


Try

MyObjSearcher = New System.Management.ManagementObjectSearcher(MyMgtScope.Path.ToString, _
"Select * From Win32_Service WHERE Name = ''remoteregistry'' ")

'' Execute the query
MyColl = MyObjSearcher.Get()

For Each MyObj In MyColl
Dim RemoteReg As String

RemoteReg = (MyObj("state"))

If RemoteReg = "Stopped" Then
RemoteRegistryService = "Remote Registry Service is " & RemoteReg & vbCrLf
End If
Next



Catch ex As Exception

End Try

推荐答案

该代码段有些难以理解,但是您可以从 [
The code snippets are a bit unreadable, but you can find out how to do it from this[^] article. Same with this[^] article.


这篇关于富文本框中的图像和文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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