|
-
Dec 29th, 2006, 05:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Align Centre in MSHFlexgrid
Can someone help me out here?
Why is it that even though I have defined a column to align to centre, the numerical values in the column correctly align but a column header (which is text) still aligns to left. Below is the code that I'm using.
VB Code:
x=10
MSHFlexgrd.ColAlignment(1) = flexAlignCenterCenter
MSHFlexgrd.TextMatrix(0, 1) = "Column Header"
MSHFlexgrd.TextMatrix(2, 1) = x
-
Dec 29th, 2006, 05:43 PM
#2
Re: Align Centre in MSHFlexgrid
but a column header (which is text) still aligns to left.
For the header you need to use
VB Code:
MSHFlexGrd.ColAlignmentHeader(1) = 4
'or
MSHFlexGrd.ColAlignmentHeader(1) = flexAlignCenterCenter
Hope this helps...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 06:14 PM
#3
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Koolsid,
Didn't realise that but for some reason it's still not working???
-
Dec 29th, 2006, 06:18 PM
#4
Re: Align Centre in MSHFlexgrid
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 06:39 PM
#5
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Yea,
Tried 1, 2, 3, 4 & 5 and none of them did anything to the alignment. 
There is .ColHeader and .ColHeaderCaption which I haven't used yet
at the moment I have just used the .TextMatrix(0,i) to enter the Column header text but not sure what the difference would be.
Last edited by sgrya1; Dec 29th, 2006 at 06:43 PM.
-
Dec 29th, 2006, 06:44 PM
#6
Re: Align Centre in MSHFlexgrid
Maybe it's my mistake
the syntax is
http://msdn.microsoft.com/library/de...ntProperty.asp
what is the band number? try it with bandnumber.
Hope this finally helps 
ps: your other thread regarding Wheelmouse scroll MDI application child forms doesn't give you that error anymore... http://vbforums.com/showthread.php?t=444999
Last edited by Siddharth Rout; Dec 29th, 2006 at 06:49 PM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 07:35 PM
#7
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Can't seem to work out what the band number is. Row number = 0 doesn't seem to work.
ie. MSHFlexgrid.ColAlignmentHeader(0, 1) = flexAlignCenterCenter
-
Dec 29th, 2006, 07:39 PM
#8
Re: Align Centre in MSHFlexgrid
Alignment works just fine in the "regular" MsFlexGrid so if you don't Hierarchical grid then switch to MsFlexGrid instead.
And you only need to set ColAlignment - it doesn't have ColAlignmentHeader:
MSHFlexgrd.ColAlignment(1) = flexAlignCenterCenter
-
Dec 29th, 2006, 08:02 PM
#9
Re: Align Centre in MSHFlexgrid
Alignment works just fine in the "regular" MsFlexGrid so if you don't Hierarchical grid then switch to MsFlexGrid instead.
And you only need to set ColAlignment - it doesn't have ColAlignmentHeader:
MSHFlexgrd.ColAlignment(1) = flexAlignCenterCenter
Hmmm... Hi Check this out ...
@sgrya1: I might be wrong (just a thought)... do the string in the header have any leading/trailing spaces?
I am sure that it has to do something with the bandnumber...will search msdn for some info and get back...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 08:17 PM
#10
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Koolsid,
Thanks, There are no leading or trailing spaces. Your last link linked to the same location as the one before it.
Rhinobull,
I have to use the MSHFlexgrid as I found a while back that there were printing problems with the "regular" MsFlexGrid. For some reason it printed out as a solid black box.
This is strange,
Rather than:
MSHFlexgrd.TextMatrix(0, 1) = "Column Header" (Which Aligns Left)
x=10
MSHFlexgrd.TextMatrix(2, 1) = x (Aligns Right while the rest of the column is still centre)
So it's definately something to do with the .colheader
MSHFlexgrd.TextMatrix(0, 1) = x
-
Dec 29th, 2006, 08:17 PM
#11
Re: Align Centre in MSHFlexgrid
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 08:28 PM
#12
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Thanks for the link koolsid.
"Unfortunately, while the control works like a charm in this respect, in other areas it's rather clunky. For instance, when it comes to applying data formats to entire grid columns, this control falls short."
Read the rest but still no joy.
That explains that the band is the row number though.
\par \tab For I = 0 To .Bands - 1
\par \tab\tab For x = 0 To .Cols(I) - 1
\par \tab\tab\tab header = .ColHeaderCaption(I, x)
-
Dec 29th, 2006, 08:29 PM
#13
Re: Align Centre in MSHFlexgrid
 Originally Posted by sgrya1
... I found a while back that there were printing problems with the "regular" MsFlexGrid. For some reason it printed out as a solid black box...
I am clueless as to what that might be ... It's the first time I've heard that. How did you "print" your grid?
-
Dec 29th, 2006, 08:43 PM
#14
Re: Align Centre in MSHFlexgrid
Guess what?????
it works....
uploading the project files in few minutes...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 08:53 PM
#15
Re: Align Centre in MSHFlexgrid
Here are few things, i would like to mention...
1) right click on the MSHFlexGrid1 and click on properties...
2) under the tab 'General' change Allowuserresizing to 'Both' so when you resize the column, u'll see the effect at runtime
keep the value of fixed col and fixed rows to 0
3) Under the 'bands' tab check the option 'columnheader'
4)
VB Code:
Private Sub Form_Load()
MSHFlexGrid1.ColAlignmentHeader(0, 1) = 4
End Sub
Hope this helps...
Last edited by Siddharth Rout; Mar 25th, 2007 at 08:41 AM.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 08:55 PM
#16
Re: Align Centre in MSHFlexgrid
Puhleeezzzzzz tell me it works.......... 
Have been scratching my head on this for hours now... lol
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 08:56 PM
#17
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
Thank you so much koolsid!!! It's got be baffled.
RhinoBull
Was a bit devestated when I found that I couldnt easily print a form with all controls. With a bit of help I ended upworking it out and posted ithere.
-
Dec 29th, 2006, 08:59 PM
#18
Re: Align Centre in MSHFlexgrid
Well, there is a better way of doing it but as long as it works for you that's what matters I guess.
-
Dec 29th, 2006, 09:01 PM
#19
Re: Align Centre in MSHFlexgrid
Thank you so much koolsid!!! It's got be baffled.
Is that a yes? lol (is it working?)
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Dec 29th, 2006, 09:15 PM
#20
Thread Starter
Fanatic Member
Re: Align Centre in MSHFlexgrid
You've got to be kidding me. How the did you work that out?
I've had a bit of a play around already. It was the fixed col and fixed row values which were the problem. They were set to 1 and when I changed them to 0 I get my flexAlignCenterCenter.
Thankyou!! Have to give you some reputation tomorrow too!!!
OMG!! Didn't even know there was a additional properties screen for controls.
RhinoBull. Please elaborate!! I was battling the print form problem for a week.
Last edited by sgrya1; Dec 29th, 2006 at 09:35 PM.
-
Apr 29th, 2024, 02:58 PM
#21
Banned
Re: [RESOLVED] Align Centre in MSHFlexgrid
Last edited by elRuffsta; Apr 29th, 2024 at 03:04 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|