|
The exception object has a stack trace which will end with the method that you are in.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Thanks Graus
That one did the trick
Dana
|
|
|
|
|
hi all
i am working on a project that uses a tab control having three tabs, now i need to add a zoom feature on the form that will allow the tab control to zoom in and zoom out with every control on it as well. if some one has any idea about it then please let me know. thanks in advance.
help everyone
|
|
|
|
|
One way to achieve Zoom effect with TabControl is to increase or decrease size of tab control and all of its pages including its contents according to the Zoom factor which is required.
I tried to implement this functionality with a tab control and following code should give you the desired result-
---------------------Code Start--------------------------------------------------------
Code to ZoomIn-
----------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnZoomIn.Click<br />
<br />
Dim ZoomFactor As Integer = 25 'In percent <br />
<br />
For Each tbpg As TabPage In Me.TabControl1.TabPages<br />
<br />
For Each cntrl As Control In tbpg.Controls<br />
<br />
cntrl.Width += cntrl.Width * ZoomFactor / 100<br />
cntrl.Height += cntrl.Height * ZoomFactor / 100<br />
<br />
cntrl.Left += cntrl.Left * ZoomFactor / 100<br />
cntrl.Top += cntrl.Top * ZoomFactor / 100<br />
<br />
cntrl.Refresh()<br />
<br />
Next<br />
<br />
Next<br />
<br />
Me.TabControl1.Width += Me.TabControl1.Width * ZoomFactor / 100<br />
Me.TabControl1.Height += Me.TabControl1.Height * ZoomFactor / 100<br />
<br />
Me.TabControl1.Refresh()<br />
<br />
End Sub
---------------------------------
Code to ZoomOut –
---------------------------------
<br />
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnZoomOut.Click<br />
<br />
Dim ZoomFactor As Integer = 25 'In percent <br />
<br />
For Each tbpg As TabPage In Me.TabControl1.TabPages<br />
<br />
For Each cntrl As Control In tbpg.Controls<br />
<br />
cntrl.Width -= cntrl.Width * ZoomFactor / 100<br />
cntrl.Height -= cntrl.Height * ZoomFactor / 100<br />
<br />
cntrl.Left -= cntrl.Left * ZoomFactor / 100<br />
cntrl.Top -= cntrl.Top * ZoomFactor / 100<br />
<br />
cntrl.Refresh()<br />
<br />
Next<br />
<br />
Next<br />
<br />
Me.TabControl1.Width -= Me.TabControl1.Width * ZoomFactor / 100<br />
Me.TabControl1.Height -= Me.TabControl1.Height * ZoomFactor / 100<br />
<br />
Me.TabControl1.Refresh()<br />
<br />
End Sub
----------------------Code End---------------------
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
thank you verry much for your kind help,
but i need to enlarge the font size of each control and also control the anchoring of each control.
i think the reason behind the unusual behavior of the tab control is that i set the location of the tab control on form's load event.
let me tell you what i did
i take a panel, place the tab control on that panel so that the panel become the parent of the tab control, now i set the auto scroll property of panel to true, set the dock property of panel to fill. this will zoom the tab control, the other control on each tab but the font size remains same. what else i can do to work it properly.
i more thing i have one more tab control on the first tab page of the main tab control. the things goes complicated now with this second tab control.
thanks in advance
help everyone
-- modified at 6:50 Wednesday 24th October, 2007
|
|
|
|
|
Font can be resized using code like this-
cntrl.Font = New Font(cntrl.Font.Name, cntrl.Font.Size + cntrl.Font.Size * ZoomFactor / 100, cntrl.Font.Style, GraphicsUnit.Pixel)
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
|
Again you did not Google, you must learn to google before you post. you will be ignored here. We need real Questions, not this. If you have bought a book and Stop spending money on weekend with friends, then you would have know the Answer.
http://www.google.co.za/search?hl=en&q=IsError&meta=[^]
it will help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
He's from Myanmar, so a surplus of disposable income is probably not something he has to worry about...
Paul Marfleet
|
|
|
|
|
As someone else said, you can't learn at this basic level by flooding the forums, you need to bu ya book.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Hi,
In regards to your question I would like mention that
IsError is a Method which returns a Boolean value indicating whether an expression is an exception type.
IsError returns True if the expression represents an Object variable that derives from the Exception class in the System namespace.
The following code snippet will explain how we can use the IsError Method.
Sub demonstrateIsError(ByVal firstArg As Integer)
Dim returnVal As New Object
Dim badArg As String = "Bad argument value"
Dim errorCheck As Boolean
If firstArg > 10000 Then
returnVal = New System.ArgumentOutOfRangeException(badArg)
End If
errorCheck = IsError(returnVal)
End Sub
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
|
i want you to Say with me
next time i will google before i post in a Forum
here is what you are looking for in Google.
http://www.google.co.za/search?hl=en&q=byref+and+byvalue&meta=[^]
it will help
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
This question (and your other one) suggest that you haven't learnt the basics of the language yet.
You shouldn't really ask questions like this in the forum. This information is freely available in the documentation[^]. I suggest you read it and learn the language fundamentals before posting again.
Paul Marfleet
|
|
|
|
|
the actual value is stored in variable in by val and in byval reference is stored in the variable and actual data is stored in the heap
|
|
|
|
|
Actually, you're answer is very wrong.
You might want to Google it yourself too.
|
|
|
|
|
Every variable or literal is stored somewhere in memory.
When you 'pass a variable by reference' the address of the actual variable is passed to the subroutine/function. You are working with the actual data value. Passing by reference is good for large data structures, and objects. Changing the values of 'by ref' parameters is sometimes called a 'side effect'. Normally one does not do this.
When you 'pass by value' the runtime makes a copy of the variable. The subroutine receives the copy. Whatever changes the subroutine makes to the variable - will not affect the calling program, since the 'by value' copy will be discarded, when the subroutine returns. There is no way you can have the 'side effect'.
|
|
|
|
|
Hello
I m using crystal report 9 in my vb.net Application my problem is that when i Called the Report whose Data Source is a text file, from my vb.net application the system gives me the runtime error
Query Engine error :HY000 [MICROSOFT][ODBC TEXT DRIVER] THE MICROSOFT JET DATABASE IS CANNOT OPEN THE FILE (UNKNOWN).IT IS ALREADY OPEN EXCLUSIVELY BY ANOTHER USER OR U NEED PERMISSION TO VIEW ITS DATA
ERROR IN FILE C:\DOCUMEN~1\USER\LOCALS~1\TEMP\CRRPT.RPT QUERY ENGINE ERROR
however i m using the code to for crystal report viewer control as
Me.CrystalReportViewer1.Refresh()
Dim strPathName As String
Dim reportDocument1 As New CrystalDecisions.CrystalReports.Engine.ReportDocument
strPathName = "D:\CrReport.rpt"
reportDocument1.Load(strPathName)
Me.CrystalReportViewer1.ShowExportButton = True
Me.CrystalReportViewer1.ShowPageNavigateButtons = True
Me.CrystalReportViewer1.ReportSource = reportDocument1
please please help me out
|
|
|
|
|
Well, I don't use CrystalReports. By the error message either the file you gave the report doesn't exist (or the path to it is wrong), or the file is already held open by some other code in your app or some other external application.
Did your code open this file somewhere else and not close it??
|
|
|
|
|
i can't find all the nodes...using DOM
Let me expalain the problem
here is my xml
[CODE]
<study>
<document>
<title>title of file</title>
<file-tag info-type="2">
<property info="3">1</property>
</file-tag>
<file-tag info-type="4">
<property info-type="5">2</property>
</file-tag>
<file-tag info="6">
<property type="7">3</property>
</file-tag>
</document>
</study>
[/CODE]
i just want to remove to remove the "property" tag and place them after the "title" tag
i have code it like
<br />
objDomUpdate.Load ("\\Path of XML")<br />
objDomUpdate.async = False<br />
objDomUpdate.validateOnParse = False<br />
objDomUpdate.preserveWhiteSpace = True<br />
Dim i, iCou As Integer<br />
Set oNodeList = objDomUpdate.getElementsByTagName("document")<br />
<br />
Dim Count As Integer<br />
For Count = 0 To oNodeList.length - 1<br />
Set oNode = oNodeList.Item(Count)<br />
For i = 0 To oNode.childNodes.length - 1<br />
If StrComp(oNode.childNodes(i).nodeName, "file-tag", vbTextCompare) = 0 Then<br />
If oNode.childNodes(i).childNodes.length > 0 Then<br />
For iCou = 0 To oNode.childNodes(i).childNodes.length - 1<br />
''Set oDemonode = oNode.appendChild(oNode.childNodes(i).childNodes(iCou))<br />
Set oDemonode = oNode.insertBefore(oNode.childNodes(i).childNodes(iCou), oNode.childNodes(1))<br />
'MsgBox (oNode.childNodes(i).childNodes(iCou).nodeName)<br />
Next<br />
End If<br />
End If<br />
Next<br />
Next<br />
objDomUpdate.Save ("C:\test.xml")<br />
from the above code i just move 2 property tag but i can't move the last one.
why???
where i am wrong ???
please help..
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
I'm no expert in XML, but it would appear that you could do this much easier with an XML Transform. Though, I don't know for sure, nor do I know exactly how to do it.
But, back to your code. XML and XPath give you LOTS of power to do searching and retrieving of nodes and you're not using it at all. There's definitely lots more code here than there needs to be. First, get the document node and hold onto it. Then get a collection of the property nodes. All you need to do is enumerate that collection and call InsertBefore on the document node for each property node:
(assuming VB.NET!)
' Find the first 'document' node wherever it shows up in the XML.
Dim documentNode As XmlNode = objDomUpdate.SelectSingleNode("//document")
' Get all of the 'property' nodes, no matter where they show up inside the 'document' node.
Dim propertyNodes As XmlNodeList = documentNode.SelectNodes("//property")
' Move each 'property' node to before the FirstChild node of the 'document' node.
For Each propertyNode As XmlNode In propertyNodes
documentNode.InsertBefore(propertyNode, documentNode.FirstChild)
Next
Done!
|
|
|
|
|
helloo....
i have problem page navigation in my report viewer,,,the first load page navigation always display total page is totalpage-1
for example, i have 10 page.....
in first load pageNavigation will say 1 of 9, but if I click next page, PageNavigation will say 1 of 10,,what is false in me program
please help me,,,,
|
|
|
|
|
If you click back to the first page, does it still say 1 in 9, or does it say 1 in 10, if the report is 10 pages long??
This post[^] may shed some light on the issue.
|
|
|
|
|
If click back to the first page, it still say 1 in 10,, the problem is only the first load....
what must i do?
|
|
|
|
|
Nothing. The ReportViewer hasn't finished its internal rendering, adn therefor, page count, when you see the first screen. If your report was a thousand pages long, you'd see the same thing. There's really nothing you can do about it.
The reason for this is imple. Say the report is 300 pages long. Would you really want the user staring at a blank screen while the RV control figures out how many pages are in the report? Or would you want the user to start looking at the report's first few pages while the control does its internal rendering and figures out how many pages are in it??
Something else you haven't run into yet is that the number of pages you see in the report (even after rendering is finished) CAN and probably WILL be different than the number of actual pages printed!
|
|
|
|