//ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) private void ShowResults() { string tmpstr = ""; //Try if (list.Count == 0) { showFeedback("Search for " + TextBox1.Text + " returned 0 results.", true); return; } //Dim g As Graphics = e.Graphics() // this exists only for the type comparison //Dim tmptbox As WNBTBox.TBox = New WNBTBox.TBox(Nothing, Nothing) Overview tmptbox = new Overview(); // this type comparison should be fixed, the tmptbox is a waste of resources //If Not Object.ReferenceEquals(PictureBox1.Tag.GetType, tmptbox.GetType) Then if ((!object.ReferenceEquals(pbobject.GetType(), tmptbox.GetType()))) { //Dim tb As WNBTBox.TBox = New WNBTBox.TBox(5, 5) Overview tb = new Overview(); //TextBox3.Text = "" tb.useList(list, help, ref tmpstr); if ((help != null) & !string.IsNullOrEmpty(help)) { tmpstr = "<p>" + Strings.Replace(help, "vbcrlf", "<br />") + "</p>" + tmpstr; } tmpstr = Strings.Replace(tmpstr, Constants.vbLf, Constants.vbCrLf); tmpstr = Strings.Replace(tmpstr, Constants.vbCrLf, "", 1, 1); tmpstr = Strings.Replace(tmpstr, "_", " "); showFeedback(tmpstr, true); //HtmlViewer1.Document.close() //HtmlViewer1.Document.Write(tmpstr) //objdoc.write(tmpstr) //TextBox3.Text = tmpstr if (string.IsNullOrEmpty(tmpstr) | tmpstr == "<font color='green'><br />" + Constants.vbCr + " " + TextBox1.Text + " has no senses </font>") { showFeedback("Search for " + TextBox1.Text + " returned 0 results.", true); } HtmlViewer1.Visible = true; //TextBox1.Enabled = True //HtmlViewer1.SelectionLength = 0 //Timer1.Enabled = False pbobject = tb; } TextBox1.Focus(); //Dim t As WNBTBox.TBox = pbobject 'CType(pbobject, WNBTBox.TBox) //t.paint(g, False) //Catch ex As Exception //MsgBox("ShowResults: " & ex.Message) //End Try }