📄 uarcomp.vb
字号:
Public Class frmUARComponent
Dim start As Integer = 0
Dim indexOfSearchText As Integer = 0
Dim lastPosition As Integer = 0
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
If Trim(txtSearch.Text) = "" Then
MsgBox("Please Select Text")
End If
Dim startindex As Integer = 0
Dim occur As Integer = 0
Dim i As MsgBoxResult
Dim fla As Boolean = False
If txtSearch.Text.Length > 0 AndAlso rtbcomponent.TextLength > 0 Then
Do While startindex >= 0
startindex = SearchMyText(txtSearch.Text.Trim(), start, rtbcomponent.Text.Length)
If fla = False Then
lblfirst.Text = "Occurance 1 : Position :" & startindex
fla = True
lblfirst.Visible = True
End If
' If string was found in the RichTextBox, highlight it
If startindex >= 0 Then
' Set the highlight color as red
rtbcomponent.SelectionColor = Color.Red
' Find the end index. End Index = number of characters in textbox
Dim endindex As Integer = txtSearch.Text.Length
' Highlight the search string
rtbcomponent.Select(startindex, endindex)
' mark the start position after the position of
' last search string
start = startindex + endindex
occur = occur + 1
End If
Loop
lbllast.Text = "Occurance " & occur & " : Position :" & lastPosition
lbllast.Visible = True
i = MsgBox("The no of Occurance of " & Trim(txtSearch.Text) & " is: " & occur & vbCrLf & " Search same text ?", MsgBoxStyle.YesNo)
If i = MsgBoxResult.Yes Then
start = 0
indexOfSearchText = 0
Else
rtbcomponent.Text = ""
txtSearch.Text = ""
txtNumber.Text = ""
lblfirst.Text = ""
lbllast.Text = ""
End If
Else
MsgBox("Please Select Text")
End If
End Sub
Public Function SearchMyText(ByVal txtToSearch As String, ByVal searchStart As Integer, ByVal searchEnd As Integer) As Integer
Dim retVal As Integer = -1
If searchStart >= 0 AndAlso indexOfSearchText >= 0 Then
If searchEnd > searchStart OrElse searchEnd = -1 Then
lastPosition = indexOfSearchText
indexOfSearchText = rtbcomponent.Find(txtToSearch, searchStart, searchEnd, RichTextBoxFinds.None)
If indexOfSearchText <> -1 Then
retVal = indexOfSearchText
End If
End If
End If
Return retVal
End Function
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
start = 0
indexOfSearchText = 0
' If searchStart > 0 AndAlso searchEnd > 0 AndAlso indexOfSearchText >= 0 Then
rtbcomponent.Undo()
' End If
lblfirst.Text = ""
lbllast.Text = ""
lblfirst.Visible = False
lbllast.Visible = False
End Sub
Private Sub btnNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNumber.Click
If txtNumber.Text = "1" Then
rtbcomponent.Text = "This should be a unique identifier for the purposes of filing. If more than one person is working on the project or more than one analysis technique is being used, this identifier could contain letters and numbers. For example, if Chris Smith and Jan Koo are both doing an analysis, the identifier might be CS1 or JK75. If both a heuristic evaluation and a think-aloud usability study were used, the identifiers might be HE6 or TA89. Follow the unique identifier with the word 'Problem,' if the report pertains to a usability problem of the interface, or the words 'Good Feature,' if it describes an aspect of the interface you feel should be preserved in any redesign."
ElseIf txtNumber.Text = "2" Then
rtbcomponent.Text = "This description will be used as the 'name' of this UAR when you talk about its relation to other UARs. Make the name as short as possible (about three to five words) but still descriptive and distinguishable from other aspects of the system. If this UAR is about a problem (as opposed to a good feature), make sure you have a name that describes the problem, rather than a solution."
ElseIf txtNumber.Text = "3" Then
rtbcomponent.Text = "This is the objective supporting material that justifies your identifying the aspect as worthy of report. This section needs to contain enough information for a reader of this UAR to understand what triggered the report. For an HE report, for instance, this could be an image of a cluttered screen and the heuristic about aesthetics and minimalist design. In a think-aloud study this is usually what was on the screen (a screen shot or description), what the user did (keystrokes, mouse movements), what the system did in response to any user actions, and what the user said. You need to include enough pertinent information about the identification of an aspect for the reader to understand what the analyst was thinking when the aspect was identified (for HE) or what the user was trying to do when the aspect either hindered or facilitated his or her progress."
ElseIf txtNumber.Text = "4" Then
rtbcomponent.Text = "This is your interpretation of the evidence. That is, for a think-aloud usability test, why you think what happened happened, or, for an HE, why you think the aspect was designed the way it was. You need to provide enough content in this explanation for the reader to understand the problem-even if they do not know the system or domain as well as you do."
ElseIf txtNumber.Text = "5" Then
rtbcomponent.Text = "This is your reasoning about how important it is to either fix this problem or preserve this good feature. This includes how frequently the users will experience this aspect, whether they are likely to learn how it works, whether it will affect new users, casual users, experienced users, etc."
ElseIf txtNumber.Text = "6" Then
rtbcomponent.Text = "If this aspect is a problem (as opposed to a good feature to be preserved in the next version of the software), this is the place to propose a solution. It is not necessary to have a solution as soon as you identify a problem-you might find after analyzing the whole interface that many problems are related and can all be fixed by making a single broad change instead of making several small changes. However, if you do propose a possible solution, report any potential design trade-offs that you see"
ElseIf txtNumber.Text = "7" Then
rtbcomponent.Text = "It is often the case that UARs are related to each other. This is where you record which UARs this one is related to and a statement about how it is related. Make sure that all the related UARs point to each other. It is a common mistake to enter the pointer into a newly created UAR, but neglect to go back to the previous ones that it relates to and update their UARs."
Else
MsgBox("Please Enter Values Between 1 and 7")
End If
End Sub
Private Sub txtNumber_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtNumber.TextChanged
rtbcomponent.Text = ""
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -