我正在修复一个基于Visual Basic 6代码的旧应用程序。要求在表单底部添加状态栏。我的状态栏如下:
我可以正确显示文本,但我也想添加红色背景色。我发现StatusBar面板没有这样的选项。当我打开StatusBar的属性时,它显示如下:
我发现我可以添加图片。但是当我添加红色图片时,文字将被图片覆盖。我被困住了。任何建议都会有所帮助。谢谢!!
更新
我只是使用了注释中提供的@ÉtienneLaneville链接中的代码。添加了背景色和文本。
这是我调用该函数的代码:
PanelText StatusBar1, 9, "ATM (" & cntATM & ")", QBColor(12), QBColor(0)
Run Code Online (Sandbox Code Playgroud)
但是文本位置如下:
我必须像下面这样放置文本才能定位它,因为此任务目前很紧急,我没有时间进行更多研究。
PanelText StatusBar1, 9, "ATM (" & cntATM & ") ", QBColor(12), QBColor(0)
Run Code Online (Sandbox Code Playgroud)
以下是我的输出:
更新2
我尝试了Brian M Stafford提供的代码。但是我得到了相同的结果。文本仍不在中心(或向左)。以下是我的代码和状态栏的屏幕截图:
功能:
Private Sub PanelText(sb As StatusBar, pic As PictureBox, Index As Long, aText As String, bkColor As Long, _
fgColor As Long, lAlign As Integer)
Dim R As RECT
SendMessage sb.hWnd, SB_GETRECT, Index - 1, R
With pic
Set .Font …Run Code Online (Sandbox Code Playgroud) 我将使用java创建CSV文件.这是代码的一部分:
try{
FileWriter writer = new FileWriter(sFileName);
writer.append("Title");
for(StoredArticle sa3:historyFile.keySet()){
for(String k3:sa3.getTimeAndPopularity().keySet()){
writer.append(',');
writer.append(k3);
}
}
writer.append('\n');
Run Code Online (Sandbox Code Playgroud)
问题是我成功创建了CSV文件.在for循环中,k3是以格式表示的时间2013/07/22 15:40:23.但是秒"23"无法显示.其他人表现良好.有什么问题请帮忙.
这是我全班的代码
package uk.ac.ncl.fanyaoxia.createCSV;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import uk.ac.ncl.fanyaoxia.monitor.MonitorRecentUpdates;
import uk.ac.ncl.fanyaoxia.monitor.StoredArticle;
import uk.ac.ncl.fanyaoxia.webpagefetch.ReadXml;
public class CreateCSVFile {
private static Map < StoredArticle, ReadXml > historyFile;
public CreateCSVFile() {
historyFile = new HashMap < StoredArticle, ReadXml > ();
}
public void createFile() {
generateCsvFile("HistoryTable.csv");
}
private static void generateCsvFile(String sFileName) {
MonitorRecentUpdates csvFile = new MonitorRecentUpdates(); …Run Code Online (Sandbox Code Playgroud) 我正在使用此网站上的代码:https : //developers.google.com/web/tools/workbox/modules/workbox-routing
我的代码如下:
workbox.routing.registerRoute(
new RegExp('http://localhost:64445.*/'),
workbox.strategies.staleWhileRevalidate({
cacheName:'Post-Run-time-cache'
}),
'POST'
);
Run Code Online (Sandbox Code Playgroud)
它给了我错误:
Uncaught (in promise) TypeError: Request method 'POST' is unsupported
Run Code Online (Sandbox Code Playgroud)
我不知道出了什么问题。它来自文档,但不受支持??为什么。谢谢您的帮助。
我有一个ASP.Net应用程序来调用AS400程序,以便在QTEMP下创建一个文件.但是当我尝试从QTEMP中选择此文件时,它不存在.
我明白原因:调用程序和选择文件是不同的工作.我无法访问其他工作的QTEMP.
我对AS400知之甚少,我能找到的唯一方法就是在QTEMP以外的其他库下创建这个文件.但它会影响我不想做的其他应用功能.
我使用cwbx.dll来调用AS400程序,然后我使用IBM.Data.DB2.iSeries从QTEMP中选择文件.显然他们是两个连接打开.我不确定是否在as400概念下,它们可能是两个独立的工作.
这是调用程序的函数:
As400Caller1.CallAs400Program("myProgram", "myLibrary", paramsList1);
Run Code Online (Sandbox Code Playgroud)
这是CallAs400Program函数:
public void CallAs400Program(string programName, string libraryName, List<AS400Param> parameters) {
try
{
system.Connect(cwbcoServiceEnum.cwbcoServiceRemoteCmd);
//check connection
if (system.IsConnected(cwbcoServiceEnum.cwbcoServiceRemoteCmd) == 1)
{
//create a program object and link to the system
Program program = new Program();
program.LibraryName = libraryName;
program.ProgramName = programName;
program.system = system;
//create a parameter collection associated with the program and pass data
ProgramParameters prms = new ProgramParameters();
foreach (AS400Param p in parameters)
{
prms.Append(p.ParameterName, cwbrcParameterTypeEnum.cwbrcInout, p.ParameterLength);
if (!p.OutParam)
{
prms[p.ParameterName].Value …Run Code Online (Sandbox Code Playgroud) 这个问题非常简单....我有一个for循环来打印标题列表并将结果附加到GUI的TextArea.例如,列表包含标题A,B,C.每次TextArea都应逐一显示标题.但是,就我而言,打印输出始终显示整个标题列表.我的TextArea方法在for循环中调用.它应该附加每个循环的打印输出,但不是整个列表.如何解决它请帮助...
抱歉令人困惑......我正在使用JTextArea来显示结果.这是代码:
private static JTextArea textArea1;
....
....
textArea1 = new JTextArea(26, 38);
textArea1.setLineWrap(true);
textArea1.setEditable(false);
sbrText = new JScrollPane(textArea1);
sbrText.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
....
....
public static void getStringText() {
String ptime = passdata.getTime();
String ppid = passdata.getPageid();
String ptitle = passdata.getTitle();
String previd = passdata.getrevid();
String pparentid = passdata.getParentId();
String puser = passdata.getUser();
String pcomments = passdata.getComments();
textArea1.append("Timestamp: " + ptime + "\n" + "Pageid: " + ppid
+ "\n" + "Title:" + ptitle + "\n" + "Revid:" + previd + "\n" …Run Code Online (Sandbox Code Playgroud)