Apr 11, 2011 at 11:22 PM
Edited Apr 11, 2011 at 11:35 PM
Hi Arik and tompsonn,
tompsonn, I'm the guy that replied to your other post about using my.settings for the minimized state.
I've been trying to use my.settings to save the Quick
Access Toolbar (QAT) settings, but haven't gotten it to work. I was wondering if you had any luck with arik's suggestion looking at the QAT sample application. I looked at the sample
application and saving and loading settings seems to work for 1 session only. In other words, after restarting the application, opening/loading the QAT settings has no effect (the settings aren't saved).
So, I've been trying to save the QAT settings stream as a string in my.settings so the settings would still be saved after restarting the application.
Here's what I've tried.
To save the settings (in form closing event):
' save ribbon QAT settings
Dim _stream As Stream = New MemoryStream()
My.Settings.QuickAccessToolbarSettings = _stream.ToString() ' This is a problem, .ToString() returns "System.IO.MemoryStream"
To load the settings (in form load event):
Dim _stream As Stream = New MemoryStream(System.Text.Encoding.ASCII.GetBytes(My.Settings.QuickAccessToolbarSettings))
If _stream Is Nothing Then
' do nothing
' load ribbon QAT settings
_stream.Position = 0