好纔好。所以我有一個假桌子,我需要它在每個文本框周圍都有表格邊框,並且當一個文本框比該行中的其他文字框更高時,邊框看起來完全錯誤。所以,我們所要做的就是在運行時從字面上繪製報表,這可以在任何視圖中完成,包括打印預覽。此代碼必須放置在打印事件
'step one. find out which box in the row has the greatest height value.
'You can come across this information however you want.
'It will likely depend on what data goes in the boxes.
'For the sake of the answer length we will skip that actual code
'step two. Take measurements and store them in variables.
'You will need a start point, and an end point in standard (x1,y1),(x2,y2) form.
Dim t As Integer 'top
Dim l As Integer 'left
Dim b As Integer 'bottom
'step three. Use these measurements and draw your lines.
'Try to use looping if your naming and report layout work will allow it.
Me.Line (l, t)-(l, b), RGB(0, 0, 0)
' (x1,y1)(x2,y2),pick a color
'We just drew a line straight down the length of the control
'If you plan ahead, and place a line on the report permanently on top of the first row
'and below every row, you will only need to draw vertical lines.
'The lines below each row will be pushed down by the tallest control
我希望這可以幫助。我根本不知道這些東西根本不存在。下面是關於它的MSDN信息:http://msdn.microsoft.com/en-us/library/aa221362%28v=office.11%29.aspx
你在哪裏設置了'CanGrow'屬性,詳細信息部分或者只是單個控件?看看爲整個部分設置屬性是否有幫助。 – Fink
它設置在整個細節部分以及其中的每個控件。我知道這個問題是因爲每個文本框都是獨立的,我需要一種方式讓他們一起成長,就好像他們是一張真正的桌子一樣...... – misterManager