|
Sohaib_A wrote: when only the main form is maximized first and then i open the child form in it,it doesn't open as maxmized,it opens in normail window state
If you're using MDI, this expected behaviour. MDI children are not sized based on MDI parent when opening. You control the window state of a MDI child independently.
If you want you can set the windowstate to maximized when you create the child window if the parent is maximized.
However if the child window is always taking all the space in MDI container, it isn't acting like a MDI application. It sounds more like a SDI application, like Visual Studio editor.
|
|
|
|
|
I am not using mdi.
Just adding the form as a control to the main form.
Dim as new form1
Me.controls.add(f)
'I also set the anchor properties for form1 here
this is how i am doing it.
|
|
|
|
|
'If you want you can set the windowstate to maximized when you create the child window if the parent is maximized.'
I tried this but then the form cover the entire area of the main form.I have a menu strip on the left which gets covered by it.The menu strip has to be seen all the time.
|
|
|
|
|
Ok, so this is more like SDI. Instead of using forms, could you create a user control and place the contents you now have in a form to the user control. Then add the user control to the form you're using as a main form. Possibly add a tab where you place the user control if you want to have several tabs at the same time etc.
|
|
|
|
|
Thanks for the suggestion,i could use it for my later projects.But the thing right now is that I have already made the forms ,there are several and converting them to a user control would take time.Is there any other method in you opinion?
|
|
|
|
|
Well you could try to reset the anchoring in the code. Set anchoring to none in design time and set it after creating the form. Not sure, but it could help.
|
|
|
|
|
Hello,
I have a requirement of modifying the datasource of crystal report as per user select option from form. As records per each selection are too much which reduces the performance of application, so I need to do in this way. I tried to change the datasource by setting setdatasource command but it doesn't refresh the data in report.
Thanks in advance
Regards
Ali Raza
|
|
|
|
|
Have you tried using Refresh on the report document. If that's not working, could you post the code since it would be easier to see the problem.
|
|
|
|
|
Hi,
Thanks for your reply. Basically I need to change the datasource of an On-demand sub report in the Drill event of Group in the crystal report viewer.
The first time when I set datasource to On-demand subreport it works perfectly and sub report load with the data. But next time when I set datasource to subreport the subreport doesn't come up with the new data.
The code I m using to set datasource is :
Private Sub crView_Drill(ByVal source As Object, ByVal e As CrystalDecisions.Windows.Forms.DrillEventArgs) Handles crView.Drill
Dim strsql As String
Dim objUtil As New clsReportUtil
Dim rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim ds As New DataSet
rpt = Me.crView.ReportSource
strsql = "Select * From tblDeliveryOrderHead " _
& "INNER JOIN tblCustomer ON tblDeliveryOrderHead.CustomerID = tblCustomer.CustomerID " _
& "Where CustomerName = '" & e.NewGroupName & "' "
ds = objUtil.GetDataSet(IBS_Utility.clsUtLib.GetConnectionString, strsql)
rpt.Subreports(0).SetDataSource(ds)
Dim subc As New CrystalDecisions.Shared.SubreportContext()
subc.SubreportName = rpt.Subreports(0).Name
subc.PageNumber = CType(source, CrystalDecisions.Windows.Forms.PageView).GetCurrentPageNumber
subc.Position = New System.Drawing.Point(1827, 2889)
tN.GroupLevel = e.NewGroupLevel
tN.GroupName = e.NewGroupName
tN.GroupNamePath = e.NewGroupNamePath
tN.GroupPath = New Integer() {e.NewGroupPath}
subc.ContainingGroupInfo = tN
CTyp(source,CrystalDecisions.Windows.Forms.PageView).DrillDownOnSubreport(subc)
rpt.Refresh()
End Sub
Regards
|
|
|
|
|
Just had a quick look but the first thing I noticed is that you don't set e.Handled to true . This prevents the default actions for drilling. Could that be the cause.
|
|
|
|
|
I have also tried this but it doesn't make any effect.
|
|
|
|
|
It's been a really long time since I last used Crystal so I don't remember the details accurately.
However another thing is that you don't really use source parameter. I'm wondering that are you actually creating a new subreport, but the one that you see is the one already defined in the main report. I didn't find what's the type of source in this case, but you could use debugger to see if you can take that as a starting point (use source for rpt variable instead of Me.crView.ReportSource) and so own.
|
|
|
|
|
Thanks for your suggestions. I am not creating new sub report. Sub report already exist in main report. The source parameter in this event is PageView.
Regards
|
|
|
|
|
Not sure about this, but it seems that the main report and the subreport are connected so the subreport is linked to the data in the main report datasource. Try if you can break the subreport connection (or link) in the designer with linking expert.
Another approach could be that you set and refresh both datasources (for the main report and the subreport):
...
rpt.Subreports(0).SetDataSource(ds)
rpt.SetDataSource(someOtherDs)
...
|
|
|
|
|
I've tried both the ways i.e linked & Unlinked Subreport.
The other approach I have not tried coz in case of main report I will need to hold a large dataset which holds some memory.
Regards
|
|
|
|
|
I think you should give it a try. Even if it's not the final solution, it could tell if that would solve the problem and if the problem is actually related to the main report.
|
|
|
|
|
Pl anyone Forward vb program for creating IE Toolbar with dropdown menu and icons
|
|
|
|
|
LMGTFY[^]
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
I'll swap you, if you come and paint my house
I are troll
|
|
|
|
|
Would it be possible to prevent remove/repair dialog box appearing when running setup.exe if the application is already installed? The installed program should open in that case. I'm trying to create a multimedia presentation cd. I included autorun.inf file that opens the setup.exe file. What is the best method to achieve this?
|
|
|
|
|
Don't auto run the setup.exe. Have the application you run initially from the autorun do a check, if the application doesn't exist then run setup, if it does exist then run the application.
|
|
|
|
|
Thanx Colin. I had the same in mind, but since i can only program in VB.NET, the little checking appication on startup would need VB.NET framework already installed, which still wouldn't be installed because that is the roll of setup.exe. What programming language should i use for this checking task? C++? Could you give an example checking a registry key? A little console application in VB.NET could do it, but i think it also requires .net framework, doesn't it?
|
|
|
|
|
I solved it with a console application. It turned out VB.NET console application doesn't require .NET framework to run. This is the program:
Sub Main()
Dim s As String
Dim procID As Integer
If My.Computer.Registry.GetValue("HKEY_CURRENT_USER\SOFTWARE\Subroutine\ENERGOMONT", _
"Installed", 1000) = "Yes" Then
s = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\SOFTWARE\Subroutine\ENERGOMONT", _
"Path", 2000) & "Energomont.exe"
procID = Shell(s, AppWinStyle.NormalFocus)
Else
procID = Shell("setup.exe", AppWinStyle.NormalFocus)
End If
End Sub
I just have to figure out now how to prevent the console from appearing on the screen.
|
|
|
|
|
I can't find any good examples of how to do this in CP or Google.
I want to be able to auto scale my program no matter what PC resolution is set at. I think I can use the Auto Scaling. But I can't find any good examples. Maybe someone can look at the code and see if I even have it right.
Dim ctrl As ContainerControl
Dim dimens As SizeF
Dim ratio As SizeF
ctrl = New ContainerControl
ctrl.AutoScaleMode = Windows.Forms.AutoScaleMode.Dpi
dimens = ctrl.CurrentAutoScaleDimensions
ratio = Me.AutoScaleFactor
If dimens <> ratio Then
ctrl.PerformAutoScale()
End If
I am trying to see if the design values are the same as the runtime and if not perform autoscale, but nothing happens. Can someone help, please. Thank you.
|
|
|
|
|
http://msdn.microsoft.com/en-us/library/ms229605.aspx
|
|
|
|