Hi Julian.
I'm using Devcomponents DotNetBar for my user interface, and since there's no way I can make the built-in TextDynamic toolbar emulate the look-and-feel of DNB, a customised toolbar is my only option.
Mostly, it's a doddle to implement, thanks to the really neat procedures outlined in your manual.
However, I have run up against one little problem that has defeated all my efforts to solve.
If I use a drop-down combo box to assign styles (e.g. to paragraphs), everything works fine, with the significant exception that the style change does not register on the undo/redo stacks. Other custom combo-box ops (font-size, font face) do, so the problem looks somewhat specific to this area.
If on the other hand, I use the built-in combo box to assign the same styles, the style changes do register on the undo/redo stacks, which leaves me wondering what I need to do to achieve the same result.
Here is the code for my custom combo box:
Private Memo As WPDynamic.IWPMemo = WpdllInt1.Memo
... (intermediate code snipped) ...
Private Sub tbComboStyles_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles tbComboStyles.SelectedIndexChanged
If Me.IAmLoading Then Exit Sub
Dim StyleName As String = tbComboStyles.Text
If StyleName.Length Then
Dim mCurrPar As IWPParInterface = Memo.CurrPar
Memo.CurrParAttr.Clear()
mCurrPar.StyleName = StyleName
Memo.ReformatAll(True, True)
WpdllInt1.ReleaseInt(mCurrPar)
End If
WpdllInt1.Focus()
End Sub
Alles anzeigen
Ok, it looks like it should work, but it doesn't, and for the life of me, I can't figure out why. I've tried numerous variations on the above, to no effect.
I should also mention that it makes no difference whether or not I assign the value "ParStyleSelection" to the Text property of the custom combo, for initialising with InitToolbar().
Is there any way to ensure ops like this get pushed onto the undo stack, or am I (dear heaven!) going to have to write my own undo/redo engine?
I'm emailing you two sample projects, one with the default styles combo, and one with my custom combo, so you can see the complete code.
Thanks,
Brian