有一个化学品库存打开一个txtbox,每个用于Room,Shelf,Bottle,我扫描3个项目。扫描后,它们分别在细胞M2,O2,Q2加入电子表格,细胞颜色变为黄色。有新的botte的按钮,清除bothpuxtbox的inpupt。
已经尝试过各种方法使用xlNone,-4105,xlAutomatic和0来删除单元格着色到Interior.ColorIndex = Statement并且它不起作用任何帮助将不胜感激
Option Explicit
'when i added code to these it would typ R on the textBox and M240 elsewhere without code it works
'Original program did not work had Explicitly programmed the SetFocus to advance from input box to input box and
'set a varialbe RoomCode to house the barcode but id did not work properly.
Private Sub ButtonNewBottle_Click()
'Worksheets(1).Cells(2, 17).Interior.ColorIndex = xlNone '-4105,xlAutomatic,0
Worksheets(1).Range("Q2").Interior.ColorIndex = xlNone
TextBox3.Text = ""
Cells(2, 17).Value = " "
TextBox3.SetFocus 'sends the focus to text box 3 to read another Bottle barcode
Call TextBox3_Change
End Sub
Private Sub ButtonNewRoom_Click()
TextBox1.Text = ""
Cells(2, 13).Value = " "
TextBox2.Text = ""
Cells(2, 15).Value = " "
TextBox3.Text = ""
Cells(2, 17).Value = " "
TextBox1.SetFocus 'sends the focus to text box 3 to read another
Call TextBox1_Change
End Sub
Private Sub ButtonNewShelf_Click()
TextBox2.Text = ""
Cells(2, 15).Value = " "
TextBox3.Text = ""
Cells(2, 17).Value = " "
TextBox2.SetFocus 'sends the focus to text box 3 to read another
Call TextBox2_Change
End Sub
Private Sub TextBox1_Change()
Cells(2, 13).Value = TextBox1.Text
Cells(2, 13).Interior.ColorIndex = 6
End Sub
Private Sub TextBox2_Change()
Cells(2, 15).Value = TextBox2.Text
Cells(2, 15).Interior.ColorIndex = 6
End Sub
Private Sub TextBox3_Change()
Cells(2, 17).Value = TextBox3.Text
Cells(2, 17).Interior.ColorIndex = 6
End Sub
答案 0 :(得分:0)
也许:
public HttpStatusCodeExceptionMiddleware(RequestDelegate next)
{
_next = next;
}
public async Task Invoke(HttpContext httpContext)
{
try
{
await _next(httpContext);
}
catch(HttpStatusCodeException ex)
{
httpContext.Response.Clear();
httpContext.Response.StatusCode = ex.StatusCode;
httpContext.Response.ContentType = ex.ContentType;
// write to response body
var errorObj = new { ErrorCode = ex.ErrorCode, Message = ex.Message };
var serializedJsonError = JsonConvert.SerializeObject(errorObj);
await httpContext.Response.WriteAsync(serializedJsonError);
}
}