The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Access to Worksheet Properties
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ReneM

Germany
3 Posts

Posted - 04/21/2016 :  10:13:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi Origin Team,

can you show me as an example how I can modify the row header width. Thank you.

Best regards
René

Origin Ver. and Service Release (Select Help-->About Origin): v9.1 SR3
Operating System: Win7, Win10

jasonzhao

China
262 Posts

Posted - 04/22/2016 :  02:35:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can modify the row header width with Origin C by editting values in tree, and then apply format stored in tree to worksheet.

Please refer to this page for apply format.
http://www.originlab.com/doc/OriginC/ref/OriginObject-ApplyFormat

and refer to this page for how to view the tree structure for worksheet
http://www.originlab.com/doc/OriginC/guide/Accessing-Metadata#Get_Tree
http://www.originlab.com/doc/OriginC/examples/Accessing-Worksheet-Format-with-Theme-Tree

Here is the example:

void rhWidth(int nWidth)   
{
	Worksheet wks = Project.ActiveLayer();
	Tree tr;
	vector<int> vec;
	vec.Add(nWidth);        // add the row header width value into the vector
	tr.Root.Grid.Dimensions.Horizontal.Size.nVals=vec;   // asign values to the tree	
	wks.UpdateThemeIDs(tr.Root);
	wks.ApplyFormat(tr, true, true);  // Apply format stored in tree to worksheet
}


Best regards!
Jason
OriginLab Technical Service

Edited by - jasonzhao on 04/22/2016 02:48:16 AM
Go to Top of Page

ReneM

Germany
3 Posts

Posted - 04/25/2016 :  2:34:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Nice, it works, thank you!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000