SaveSatateToXMLString... |
Post Reply |
Author | |
suja
Newbie Joined: 22 May 2008 Status: Offline Points: 4 |
Post Options
Thanks(0)
Posted: 26 May 2008 at 12:14am |
Hi~~
Help me
i want to set the State by using
SaveStateToXMLString/LoadStateFromXMLString..
when i clicked "Add or Remove Button" and Saved the State ,
the Button State was not set ....
but When i used the RegistryKey, the Button State was Set..
is there diffrence from Using Xml and RegistryKey ??
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Check that you give same string to LoadStateFromXMLString that you get from Save. Maybe you save it wrong.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
Just a quick one oleg,
as earlier mentioned, we will have the ribbonbar designer in 12.1 (correct me if am wrong). will there be a feature of importing xml generated from ribbonbar to the designer? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Yes.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
Splendid!
|
|
suja
Newbie Joined: 22 May 2008 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
would you check this method?
as i mentioned the Button State was not set ....
i want to save the state from each users. and Load that state...
'Load the State of CommandBar
Public Sub CommandBar_LoadState(ByVal argIDNumber As String, ByVal argEXEName As String) On Error Resume Next Dim FreeF As Integer, sFile As String, sLayout As String
strsql = " SELECT String From DockingpaneState " strsql = strsql & " WHERE UserID = '" & Trim$(argIDNumber) & "' " strsql = strsql & " AND EXEName = '" & UCase(argEXEName) & "' " If Not OpenADO1(strsql) Then Exit Sub sFile = "c:\" & Trim$(argIDNumber) & ".txt" FreeF = FreeFile Kill sFile Open sFile For Binary As #FreeF Put #FreeF, , Trim$(AdoRs1("String")) Close #FreeF AdoRs1.Close sLayout = Space(FileLen(sFile)) Open sFile For Binary As #FreeF Get #FreeF, , sLayout Close #FreeF On Error GoTo 0 CommandBars.LoadStateFromXMLString CommandBars.name, sLayout ' sLayout, "a" Kill sFile End Sub 'Save the State of CommandBar
Public Sub DockingPane_SaveState(ByVal argIDNumber As String, ByVal argEXEName As String) Dim nCnt As Integer strsql = "SELECT count(*) as cnt From DockingpaneState " strsql = strsql & " WHERE UserID = '" & Trim$(argIDNumber) & "' " strsql = strsql & " AND EXEName = '" & UCase(argEXEName) & "' " Call OpenADO1(strsql) nCnt = AdoRs1("Cnt") AdoRs1.Close If nCnt = 0 Then strsql = "Insert into DockingpaneState values ( " strsql = strsql & " '" & Trim$(UserID.IDNumber) & "', " strsql = strsql & " '" & UCase(argEXEName) & "', " 'strsql = strsql & " '" & Trim$(NurseMDI.DockingPaneManager.SaveStateToString) & "') " strsql = strsql & " '" & Trim$(NurseMDI.CommandBars.SaveStateToXMLString(NurseMDI.CommandBars.name)) & "' " Else strsql = " UPDATE DockingpaneState " 'strsql = strsql & " Set string = '" & Trim$(NurseMDI.DockingPaneManager.SaveStateToString) & "' " 'strsql = strsql & " Set string = '" & Trim$(NurseMDI.CommandBars.SaveStateToString(True, True)) & "' " strsql = strsql & " Set string = '" & Trim$(NurseMDI.CommandBars.SaveStateToXMLString(NurseMDI.CommandBars.name)) & "' " strsql = strsql & " WHERE UserID = '" & Trim$(argIDNumber) & "' " strsql = strsql & " AND EXEName = '" & UCase(argEXEName) & "' " End If AdoCn.BeginTrans If ExecADO(strsql) Then AdoCn.CommitTrans Else AdoCn.RollbackTrans End If End Sub [this is get from saved file]
<CommandBars CompactMode="1">
<Layout> <DockState Version="21" ScreenSize="1280, 1024" Count="2"> <BarInfo0 BarId="1" MRUWidth="32767"/> <BarInfo1 BarId="1694431857" Floating="1" MRUWidth="32767" PointPos="529, 238" MRUDockPos="545, 18, 1113, 44" MRUFloatPos="529, 238"/> </DockState> <DockBars> <DockBar0 Count="3" Id1="1"/> </DockBars> </Layout> </CommandBars> |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, Right. by default SaveStateToXMLString don't save controls state.
Create Options and set SerializeControls property:
Dim op As StateOptions
Set op = CommandBars.CreateStateOptions op.SaveOriginalControls = True op.SerializeControls = True |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |