1

I'm having two little problems that I need help with...

1) If I'm using a RichTextBox target without a form name (ie. it's creating it's own form), how can I show/hide the form that it creates? (I'd like a shortcut key in my application to be able to show/hide the log window, etc)

2) If I specify a form name and control name for my RichTextBox target control, NLog still creates it's own window. It seems like it's doing this because my log form (frmLog) isn't created until somebody clicks "Show Log Window" (button) on my main form. How can I get around this?

SofaKng
  • 1,063
  • 1
  • 11
  • 32

1 Answers1

0

Don't create the logger until the form is loaded.

Private Shared Logger As NLog.Logger = Nothing

Private Sub NewForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    NOTE: had to create this after form had loaded, couldn't do it during static initialization
    Logger = LogManager.GetCurrentClassLogger()
End Sub
Derek
  • 7,615
  • 5
  • 33
  • 58