|
oh! I'm Sorry!!!
I resolved!with this code! Thank you!
<br />
sArchivo = Dir(sFullPath2DirCliente)<br />
iCountPictureOnFirstLoad = 0<br />
<br />
Do While sArchivo <> vbNullString<br />
' If nII <= 12 Then<br />
If nII < 12 Then<br />
If mbCargarImagen(sImageRootDir & sDirCliente & sArchivo, nII) Then<br />
imgSnapshot(nII).Tag = sImageRootDir & sDirCliente & sArchivo<br />
Me.LblFechaFoto(nII).Caption = FileSystem.FileDateTime(imgSnapshot(nII).Tag)<br />
iCountPictureOnFirstLoad = iCountPictureOnFirstLoad + 1 ' By Almeda<br />
Else<br />
imgSnapshot(nII).Tag = vbNullString<br />
Me.LblFechaFoto(nII).Caption = ""<br />
End If<br />
Else<br />
Exit Do<br />
End If<br />
i = 0<br />
sCurrentFile = Dir(sFullPath2DirCliente)<br />
Do While i <= nII<br />
If sCurrentFile = sArchivo Then Exit Do<br />
sCurrentFile = Dir$<br />
Loop<br />
sArchivo = Dir$<br />
nII = nII + 1<br />
Loop<br />
|
|
|
|
|
Im having a strange issue with Visual Studio 2010.
I've been programming in VB.Net since Visual Basic Express 2003. I've also used 2005, 2008 and now 2010, both the express edition and the proffesional edition.
My experience is that with all these versions, if you hit F5 or click the Run button, you get a debug build of your application which is written to the bin\debug folder.
To get a Release version, i just go to the Build menu and hit Build solution\solutionname. This creates a Release build of your application which is written to the bin\release folder
So far so good.
But i've recently reinstalled Visual Studio 2010 and now the above is no longer the case.
When i hit F5 or the Run button, i get a debug build, just as i expected.
But when i click the Build solution\solutionname menuitem in the Build menu, i STILL get a debug build and no release build.
Why?
I just want a debug build when i hit F5\run and a release build when click the Build solution\solutionname menuitem.
This is what i got used to over the years.
Who can help me fix this?
Virtual Space Shuttle Astronaut
|
|
|
|
|
Check which project configuration type is selected in the drop down on your toolbar.
The best things in life are not things.
|
|
|
|
|
Hmm, i've never noticed that before. It was never there but now it is.
It's set to Debug.
Virtual Space Shuttle Astronaut
|
|
|
|
|
I don't use VB but that has been in every version of Visual Studio (from VC 4), Visual C++ Express (from 2005), and Visual C# Express (from 2005) that I have used.
The best things in life are not things.
|
|
|
|
|
Well, i know i never had to deal with the configuration manager before the format, i could just hit F5\run to produce a debug build, and use the Build ... menuitem to produce a release build. There was no need to switch between the debug and release configurations. This is what i got used to over the years and this is the behavior i prefer.
I don't feel like switching between Debug and Release modes every time, i never had to do that before, so why do i have to do it now? It was never an issue.
I'd like to add that this this[^] no longer applies to me, and i quote:
When you set up Visual Studio, you are asked to choose a set of Development Settings for your primary programming language. If you choose the Visual Basic Development Settings, the tool for choosing the Debug or Release configuration does not appear in the toolbar. Instead, Visual Studio automatically chooses the Debug configuration when you choose Start from the Debug menu and the Release configurations when you use the Build menu. To change the Development Settings, see How to: Restore Hidden Debugger Commands. After you change the Development Settings, make sure that Show advanced build configurations is selected in the Options dialog box, Project and Solutions category, General page.
In particular the bold part does no longer seem to be true but it is the behaviour i want. Before the format, it does exactly what it says, but after the format this no longer seems to be true as i still see the Debug configuration in my standard toolbar and click the build ... menuitem does not produce the release build.
I just don't get it.
Virtual Space Shuttle Astronaut
|
|
|
|
|
The Mighty Atom wrote: so why do i have to do it now?
No idea, maybe Microsoft know. As I said, I have not used VB so I never knew this issue existed.
The best things in life are not things.
|
|
|
|
|
That's ok.
Im hoping to get the original behaviour back, the one im used to over the years.
Hopefully someone has the solution to this, because it may not look like that big of an issue, but it is for me, it annoys the heck out of me like there's no tomorrow, i can't help it.
Virtual Space Shuttle Astronaut
|
|
|
|
|
That is totally weird! It has always done whatever is set on the menu for me whether to use build on the menu, or run or right click and build on the solution in solution explorer.
Would this be an Express thing perhaps? I have never used the Express versions and have always used the configuration manager to set things up.
|
|
|
|
|
I have the Express edition installed on my laptop and it works just fine. No need to mess with confuguration manager or anything. For a debug build, i hit F5, and for a release build, i use the Build command in the build menu.
This was the case with the proffesional edition on my main computer BEFORE i formatted. But after the format, it no longer works like that, and i hate it.
What is going on?
Virtual Space Shuttle Astronaut
|
|
|
|
|
Hi, I create Pictureboxes on Runtime and I want to use event for these Pictureboxes. How make I this? This is my code
Dim c As Collection
Dim myCollection As New Collection()
c = TwainHandler.ScanImages("C:\", "jpg")
Dim l As Integer
l = 0
Dim i As Integer
i = 0
For Each fn1 In c
i = i + 1
Next
If i Mod 2 <> 0 Then
TableLayoutPanel1.RowCount = i \ 2 + 1
Else
TableLayoutPanel1.RowCount = i \ 2
End If
TableLayoutPanel1.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
TableLayoutPanel1.AutoSize = True
i = 0
For Each fn In c
i = i + 1
Dim lab As New PictureBox
lab.BringToFront()
lab.SizeMode = PictureBoxSizeMode.StretchImage
lab.Size = New Size(100, 100)
lab.Image = Image.FromFile(fn)
TableLayoutPanel1.Controls.Add(lab)
lab.Name = "lab" & i
Next
Dim styles As TableLayoutRowStyleCollection = _
Me.TableLayoutPanel1.RowStyles
For Each style As RowStyle In styles
style.Height = 107
Next
|
|
|
|
|
Take a look at addhandler
It's easy
|
|
|
|
|
You could create a windows form object with just an empty PictureBox on it, and write the event handling in that objects code. Then instead of creating PictureBox objects you create these forms.
That way you can use Visual Studio the normal way for the look and event handling of your picture objects.
My advice is free, and you may get what you paid for.
|
|
|
|
|
have a look at the addhandler fuction
Addhandler[^]
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Hello all,
I have created the setup/installer for my application using the PDwizard. The installation is working all good (as its expected). For uninstallation, I have used a custom program (created by me) instead of directly calling the st6unst.exe. This program is called from both programs shortcut menu as well as control panel add remove programs option. Only requirement to use a custom uninstaller is to make it password protected and open access solely to system administrators. This program is also calling st6unst.exe but after verifying the password and sysadmin account. The uninstallation also is going good except one thing. It doesn't remove the application entry from add remove programs screen. I checked in the registry and found that my application entry for uninstall is still there inside the path :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ST6UNST #1...
It removed only when I manually removed the entry from control panel.
How to do this thing automatically so that the entry from registry for uninstaller will also be removed after the application is uninstalled...
Any help regarding this will be highly appreciated.
Thanks for any info in advance
regards
Shouvik (India)
|
|
|
|
|
You will probably need to remove the key in your uninstaller. See this article for some hints[^].
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I've been banging my head against the wall on this one for several hours and would appreciate some help!
Big picture: I am writing a program that reads certain disk files, processes the data in various ways, graphically displays the data, etc. The user will be able to select a subset of the processed data to save to an Excel file.
I am crafting a class I call LAExcelWrapper to perform this work. The project references Microsoft Excel 14.0 Object Library (released, I take it, with Microsoft Excel 2010).
Several of the Excel Worksheets should hold data that are essentially in the form of frequency tables. One of these, an "ILI histogram" (never mind what that is in the real world) is held in my program as a Dictionary(Of Integer, Integer) . The Key is an integer that represents a number of milliseconds and the Value is an integer representing a Count falling within that time range.
The Dictionary is a property (named ILIHistogram) of a custom class nested within other classes. However, all of the ILIHistograms share the same Keys. So my excel spreadsheet needs to have the first column be the Keys from the first instance, and then iterate through all of the instances placing the Values in the Excel columns.
Consider the following code:
Private Sub ILIHistogramSheet()
'xlSheet is declared at class level; ReturnReferenceToNextSheet is a helper function
'The lines work, delivering the ActiveSheet to xlSheet.
xlSheet = ReturnReferenceToNextSheet()
xlSheet.Name = "ILI histograms"
'Converting the Keys of the first instance to an array of integers
Dim a() As Integer = mData(0).Trials(0).ILIHistogram.Keys.ToArray
Dim r As Excel.Range
Dim rows As Integer = a.GetUpperBound(0) + 1
'Here, I want to fill the data in the first column, starting at row 7
r = DirectCast(xlSheet.Cells(6, 1), Excel.Range).Resize(6 + rows, 1)
r.Value = a
End Sub
What I was hoping would happen would be that column 1 (starting at row 7) would now fill with the integer values of my Keys. Instead, it fills with only the first Key. For example, if my keys are 10, 20, 30, 40, 50, this code gives me (starting at row 7):
10
10
10
10
10
If I alter the code above so that the range is resized as follows:
'Set range to be one row rather than one column
r = DirectCast(xlSheet.Cells(6, 1), Excel.Range).Resize(1, 6 + rows)
I get what you'd kind of expect:
10 20 30 40 50
So, frustratingly, Excel seems to use the index of the array as the column number of the range, when I want it to use it as the row number.
I can certainly get this code to work by looping through my arrays and creating one-cell ranges on the fly, but I imagine this would be terribly slow.
I can probably fool around with accessing Excel's Paste Special through interop and fill the spreadsheet "wrong" first, cut all of the data and transpose paste it, but this seems less than elegant (and given how hard Excel interop seems to be, I'm not sure I'll be able to pull it off).
Any thoughts?
|
|
|
|
|
Hi,
Google for "assign array to excel range" and you'll find plenty of people have had the same problem. Apparently the source array, 'a' in your case, should be 2 dimensional.
Alan.
|
|
|
|
|
I swear I was all over google... but using VB.net in my search may have backfired. Better to look at examples of people using VBA writing macros, and then translating. Your suggestion led me to this page[^] which led me to the odd "WorksheetFunction" methods. Here's the new code:
Private Sub ILIHistogramSheet()
xlSheet = ReturnReferenceToNextSheet()
xlSheet.Name = "ILI histograms"
SupplyHeaders()
Dim rows As Integer = mData(0).Trials(0).ILIHistogram.Keys.Count
Dim row As Integer = 7
Dim r As Excel.Range
Dim col As Integer = 1
r = DirectCast(xlSheet.Cells(row, col), Excel.Range).Resize(rows, 1)
r.Value = xlApp.WorksheetFunction.Transpose(mData(0).Trials(0).ILIHistogram.Keys.ToArray)
col = 2
For Each ls As LickometrySession In mData
For Each lt As LickometrySession.LickometryTrial In ls.Trials
r = DirectCast(xlSheet.Cells(row, col), Excel.Range).Resize(rows, 1)
r.Value = xlApp.WorksheetFunction.Transpose(lt.ILIHistogram.Values.ToArray)
Next
col += 1
Next
r = DirectCast(xlSheet.Cells(7, 1), Excel.Range).Resize(rows - 1, 1)
r.Font.Bold = True
End Sub
The key statement is r.Value = xlApp.WorksheetFunction.Transpose(lt.ILIHistogram.Values.ToArray) , where xlApp is a reference to an Excel.Application instance and ILIHistogram is the Dictionary(Of Integer, Integer) property that holds my data. The code above:
1. Gets an Excel.Range (r) in column 1 starting at row 7 and sized for the size of my array
2. Adds in one step all of my Keys
3. Starts a loop to circle through all of my custom objects holding all of my data
4. Gets a range each time one column wide and down as many rows as needed
5. Adds the data to the range in one step while transposing using the worksheet function
I'm using a relatively small dataset to test with, but already the advantage is huge. Before seeing your answer, I had coded it looping through my data, adding one cell at a time.
Old way = 233 milliseconds
New way = 32 milliseconds
Since I have 4 sheets to fill with data like this and will usually be dealing with much larger data sets, this is a nice save.
Thanks!
modified on Friday, July 1, 2011 7:55 PM
|
|
|
|
|
My webservice takes in a couple of parameters, some are integers, some are strings and some are self defined structs.
Now the integers' minOccurs and maxOccurs are set appropriately to 1. But with the strings, in both webmethods and structures, the minOccurs are set to 0. Is there a way to set them to 1 without setting <XmlElement(IsNullable:=True)> ? I don't want them to be optional and I don't want them to be null-able.
EDIT - In one webmethod, one of the parameters is an array of a self defined structure. Is it possible to set the minOccurs number? I know it can't be done with <XmlElement(IsNullable:=True)> because that gives an error in my webservice.
If I look at the WSDL description of my structures, I see that the minOccurs of the string fields is set to 0. Is there a way to change that?
I can provide code samples if necessary.
modified on Thursday, June 30, 2011 6:16 AM
|
|
|
|
|
Hi
Working in MS Access VBA want to enter a number in textbox and return some text in another textbox.
For example when enter 1 want to return in another textbox Boston.
How to make this possible?
Regards
|
|
|
|
|
KORCARI wrote: Working in MS Access VBA want to enter a number in textbox and return some text in another textbox.
For example when enter 1 want to return in another textbox Boston.
How to make this possible?
Create a form with the two text boxes. Each text box has events associated with it. In the AfterUpdate event of the first text box, check for the value entered and accordingly fill value(s) in the second text box.
HTH
|
|
|
|
|
Would also suggest you use CASE, much easier to follow and edit.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I'm making an installer of my webservices and I'm stuck at the last bit.
I'm trying to change some values in a custom xml file that I'm installing. I don't save my settings in an web.config file, but in either public, protected or private.config.xml file. I want to change the $logPath$ variable in the document with the installation path. I've figured out that with custom code I can do:
MyBase.Install(stateSaver)
Dim xmlDocument As New System.Xml.XmlDocument
Dim strPath As String = System.IO.Path.Combine(Context.Parameters.Item("TARGETDIR"), "public.config.xml")
If System.IO.File.Exists(strPath) Then
xmlDocument.Load(strPath)
xmlDocument.ToString().Replace("$logPath$", Context.Parameters.Item("TARGETDIR"))
xmlDocument.Save(strPath)
End If
Rinse and repeat for the other files. But I get an error: "1001 - parameter path1 cannot be null". That's the first parameter of the System.IO.Path.Combine() function. But it's not null, there should be a path set.
modified on Monday, June 27, 2011 10:35 AM
|
|
|
|
|
|