|
|
hi guys
i want to display a form before my application start,
i am writing code in the application events,
Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
Dim sfrm As New sp
sp.Show()
Return MyBase.OnInitialize(commandLineArgs)
End Function
problem is that controls of the sfrm are not shown ,, why ?
thanks in advance
hello
|
|
|
|
|
You are calling show, when you need to call ShowDialog, to show the form so that your app stops and waits for the form to close
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If you are displaying this screen simply as a splash, and if you are coding in VB, you can specify a Splash Screen in the Project Properties screen in the Application area. I do not believe this is available for C# though. Then you don't have to worry about this code at all, it will be handled for you.
Hope this helps.
|
|
|
|
|
I have problem with this Code
I want to display stopwath in the textbox with format "h:m", but it cannot run....!
Any body can make this Code perfect...?
Dim timePerParse As Stopwatch<br />
Dim jam1 As String<br />
stp = Stopwatch.StartNew<br />
jam1 = Format(timePerParse, "h:m").ToString<br />
Me.TextBox2.Text = jam1
Thanks at all
Best Regards,
Ahmad Rifai Yusuf
|
|
|
|
|
Ahmad Rifai Yusuf wrote: Dim timePerParse As Stopwatch
You haven't instantiated StopWatch class. Read the documentation[^]
|
|
|
|
|
I need to get the contents of a certain column of a list view from a form and put the contents of that column in the database.
How do I get the contents of a particular column of a list view?
|
|
|
|
|
Hello,
You cannot retrieve an item from the ListView using Column collection. You have to be specific
to a row or the ListViewItem. Each row is a ListViewItem with the values in each column as
subitem.
Try this line of code:
Msgbox(Me.ListView1.Items(0).SubItems(1).Text)
In the above code, Items is each row, and SubItems is each column value.
I hope this helps.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
How do I get the row value when the user selects the row from the list view?
|
|
|
|
|
Does each subitem have an index or id?
If so, how do I get the index of each subitem?
|
|
|
|
|
Hello
I would like to be able abort a function or sub when i push a button (Stop). Assume for example that
I have made an app that searches for files, and by "mistake" I enter a search argument like *.*
on a very large disc that has a very large number of files. Or maybe I just want to quit searching....
I was thinking about something like this (pardon my outrageous pseudo pseudo code)
Function SearchForfiles (some params) as SomeType<br />
<br />
here is lot of code (recursive stuff, loops and what have you)<br />
<br />
'here comes the thing I'm looking for:<br />
<br />
If (user presses the button Stop) Then<br />
Exit Function or Sub<br />
End If<br />
<br />
End Function (End Sub)
And after the user has pressed the stop button everything is normal again and he can do a wiser
search this time. So the main question is how to stop the execution of a sub routine without ending the app,
and the second question is how the function/sub is supposed to know that the user pressed a button
I hope you understand what I'm Looking for
Bye for now
Tim
|
|
|
|
|
You need to research multi-threading. You could start by researching the background worker control.
Hope this helps.
|
|
|
|
|
I found a solution myself. It's so ridiculously simple that discarded it first as TOO ridiculous. anyway here it is.
Inside the the recursive function that searches for files i have this statement:
<br />
'txtStop is an invisible textbox<br />
If txtStop.Text = "0" then<br />
Exit Function<br />
End If <br />
<br />
On the form I have a button with the caption "Stop search" and the button code is:
<br />
Private Sub btnStopSearch_Click()<br />
Me.txtStop.Text = "0"<br />
End Sub<br />
Ain't it ridiculous! Thanks for the tip though about the multi threading
|
|
|
|
|
What you're doing now is pretty obvious, the trouble is, if the processor is really busy, the UI is not going to be responsive, and so the button press won't always register.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
It does in your limited tests. Get a folder with a large number of files in it and your code will fall on its face. The button will not respond until the code returns control back to the UI to process events. This can take a while. For example, I've got 3 machines right now with over 13.5 MILLION files each in a small directory tree off the root of C:. It takes 45 minutes just to get properties on the root folder to see who much space is available.
Your use of a hidden TextBox is also very dependant on the UI being able to process and is very unnecessary. A simple Boolean variable would do the exact same thing without all the overhead of a control.
Moving the search to its own thread is a FAR better method leaving your UI responsive to every click of that button, no matter how many files there are in a folder.
On local hard drives, searches go pretty quick. When you doing the search on a remote volume over a network, these kind of searches take FAR longer, mostly hanging on remote I/O. The time your UI thread (in your implementation) is blocked (unresponsive to user actions) is FAR greater than for a search on a local drive.
|
|
|
|
|
Some poeple just don't get it
|
|
|
|
|
recurring customers?
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
How would I make a timer click for me? EX. If i clicked a button that would start the timer then the curser would start clicking at the intervel on the timer/
|
|
|
|
|
click on what? your button? if so: in timer_tick-event: button1.performclick
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
In your button's click event handler, you should use YourTimer.Start , where YourTimer is the timer you created...
"That's the problem with a spell checker. It only helps with bad spelling, not stupidity." - Rob Graham
|
|
|
|
|
Hey,
I'd like to know how I can drag and drop controls during runtime.
I am using Visual Studio 2005 --> Visual Basic.
Thanks,
--Zaegra--
|
|
|
|
|
What do you have difficulty with? Be more specific.
You need Mousedown-Event for the control you want to drag to start Drag&Drop, and DragOver- and DragDrop-Event for your control you want to drop that first control in. But I am sure you figured that out yourself.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi All
I have created a DAL using datasource and added few function and it accept from and to Date. Then added a Report Viewer control to my Windows application. After that I added new item Report1.rdlc. Then I dragged field from Dataset on to Report1 and organized and set the Datasource .rdlc to the Report Viewer control after that I executed my application working fine. Now I decided to added two datetime parameter to my Report1 and added. When I try to run the .SetParameters it thrown error as 'An error occured during local report processing'
Could you please help me how to solve.
<code> Dim rsDataSource As New ReportDataSource("OT Applied Info", OverTimeEntryTable)
Me.Reports.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
Me.Reports.LocalReport.EnableExternalImages = True
Me.Reports.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence)
Me.Reports.LocalReport.DataSources.Clear()
Me.Reports.LocalReport.ReportEmbeddedResource = "OTApplied.rdlc"
Me.Reports.LocalReport.DataSources.Add(rsDataSource)
Dim params(0) As Microsoft.Reporting.WinForms.ReportParameter
params(0) = New Microsoft.Reporting.WinForms.ReportParameter("SDate", Format(CDate(dtpSDate.Text), "MM-dd-yy"), True)
params(1) = New Microsoft.Reporting.WinForms.ReportParameter("EDate", Format(CDate(dtpEDate.Text), "MM-dd-yy"), True)
Me.Reports.LocalReport.SetParameters(params)
Reports.LocalReport.DataSources.Add(rsDataSource)
Reports.Visible = True
Reports.LocalReport.Refresh()</code>
Thanks
Sonj<big></big><big></big>
|
|
|
|
|
Hi All,
No help from any one of them however I found that ReportEmbeddedResource is follows application name for example Me.Reports.LocalReport.ReportEmbeddedResource = "ReportProject.OTApplied.rdlc"
ReportProject is my Application Name.
- sonj
|
|
|
|