|
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
|
|
|
|
|
|
Hi,
I'm rewriting a old VB6 prog into vb dotnet 2010
I need for mij cddb control the deviceID
In vb6 I get it with this code
MCICtl.DeviceType = "CDAudio"
MCICtl.Wait = True
MCICtl.filename = DriveLetter
MCICtl.Shareable = True
MCICtl.Enabled = True
MCICtl.Command = "Open"
Dim DevId
DevId = MCICtl.deviceId
TocString = Control.GetMediaToc(DevId)
Now in vbdotnet I haven't get it succesfully
the windowsmediaplayer works on other ways
Someone has can help me
I found this on the net and my idee was that SCSITargetId was the attrib that i need but no luck
Function fGetCDroms(ByVal drive As String) As Generic.List(Of Devices)
Dim WMI, Col, Ob As Object
Dim s2 As String = ""
Dim sID As String = ""
Dim l As New Generic.List(Of Devices)
Dim Toestel As New Devices
WMI = GetObject("WinMgmts:")
Col = WMI.ExecQuery("Select * from Win32_CDROMDrive")
For Each Ob In Col
Toestel = New Devices
With Toestel
.Availability = Ob.Availability
.Capabilities = Ob.Capabilities
.CapabilityDescriptions = Ob.CapabilityDescriptions
.Caption = Ob.Caption
.CompressionMethod = Ob.CompressionMethod
.ConfigManagerErrorCode = Ob.ConfigManagerErrorCode
.ConfigManagerUserConfig = Ob.ConfigManagerUserConfig
.CreationClassName = Ob.CreationClassName
.DefaultBlockSize = Ob.DefaultBlockSize
.DeviceID = Ob.DeviceID
.Description = Ob.description
.Drive = Ob.Drive
.DriveIntegrity = Ob.DriveIntegrity
.ErrorCleared = Ob.ErrorCleared
.ErrorDescription = Ob.ErrorDescription
.ErrorMethodology = Ob.ErrorMethodology
.FileSystemFlags = Ob.FileSystemFlags
.FileSystemFlagsEx = Ob.FileSystemFlagsEx
.InstallDate = Ob.InstallDate
.id = Ob.id
.LastErrorCode = Ob.LastErrorCode
.manufacturer = Ob.Manufacturer
.MaxBlockSize = Ob.MaxBlockSize
.MaximumComponentLength = Ob.MaximumComponentLength
.MaxMediaSize = Ob.MaxMediaSize
.MediaLoaded = Ob.MediaLoaded
.MediaType = Ob.MediaType
.MinBlockSize = Ob.MinBlockSize
.Name = Ob.Name
.NeedsCleaning = Ob.NeedsCleaning
.NumberOfMediaSupported = Ob.NumberOfMediaSupported
.PNPDeviceID = Ob.PNPDeviceID
.PowerManagementCapabilities = Ob.PowerManagementCapabilities
.PowerManagementSupported = Ob.PowerManagementSupported
.RevisionLevel = Ob.RevisionLevel
.SCSIBus = Ob.SCSIBus
.SCSILogicalUnit = Ob.SCSILogicalUnit
.SCSIPort = Ob.SCSIPort
.SCSITargetId = Ob.SCSITargetId
.Size = Ob.Size
.Status = Ob.Status
.StatusInfo = Ob.StatusInfo
.SystemCreationClassName = Ob.SystemCreationClassName
.SystemName = Ob.SystemName
.TransferRate = Ob.TransferRate
.VolumeName = Ob.VolumeName
.VolumeSerialNumber = Ob.VolumeSerialNumber
End With
l.Add(Toestel)
Next
Col = Nothing
WMI = Nothing
Return l
End Function
|
|
|
|
|
Never mind,
It was the players ID that I needed not that for the cdromplayer
Jan
|
|
|
|
|
I'm hesitant to ask this question since I may not understand the answer. My VB.NET (2008) skills are weak and my use of LINQ has so far been non-existent. I believe that I could get the result I want using other methods than LINQ, but this may be an opportunity for me to learn it a bit.
I have a List(Of Integer) that holds a bunch of numbers that represent durations of events in milliseconds. I need to generate a frequency table from these durations. For example, the list (usually containing about 500 elements) might be:
67, 85, 110, 112, 83, 130, 99, 105
And I might want a frequency table that looks something like this:
Duration --> Count
61-80 --> 1
81-100 --> 3
101-120 --> 3
121-140 --> 1
Here, the BinSize is 20, but this would be a user-specified value, so I don't know what my "bins" are at design-time. Also, the MaxDur might be 140 in this example, but that is also a user-specified value, so I don't know how many bins there will be at design-time. (The minimum will always be 1, so there should also be bins above for 1-20, 21-40, and 41-60 which have counts of 0).
I think it would be most useful to store the results in a Dictionary(Of Integer, Integer) where the key is the upper limit of the bin (20, 40, 60, 80, 100, 120, and 140 in this example) and the value is the counts.
Consider the following code (I'm writing off of the top of my head here):
Sub TheCaller()
'Assume we have a exampleData = List(Of Integer) with the above 8 elements
Dim count As Integer = GetFrequencies(exampleData)
End Sub
Function GetFrequencies(data As List(Of Integer)) As Integer
Return (From i In data Where i>60 And i<=80).Count()
End Function
I'm not sure I'm right, but would this return the frequency count of bin 61 to 80 milliseconds? I presume I could make 61 and 80 variables and send those as parameters to the function, but what I really want to learn how to do is generate a single function that returns a Dictionary(Of Integer, Integer) with the entire table generated. I'm thinking this requires a Group By clause. I've seen examples out there of frequency tables for a known category (e.g., count the number of orders from a particular company or the number of times a particular word appears), but I'm struggling with the fact that the number and size of my categories would be unknown.
Thanks in advance for any leads.
EDIT: In fact, I think I've got a good compromise working now. I have the caller running a Do... Loop Until iteration, retrieving the Count each time from the GetFrequencies function, which is called in the Add method of a Dictionary(Of Integer, Integer) instance. It's working well.
However, I'm still intrigued by the method ToDictionary of Enumerable. I think there is probably a more efficient (or at least concisely written) way to do this, but I'm not sure.
modified on Saturday, June 25, 2011 3:07 PM
|
|
|
|
|
How do I add a reference at runtime ?
thanks!
|
|
|
|
|
You can't; if you want something from an assembly without referencing it, you'll have to load it dynamic. You'd have to dig into the subject called "Reflection" to use the classes in that assembly.
Bastard Programmer from Hell
|
|
|
|
|
Hi all,
We are working on a financial project which uses excel sheets extensively.
Instead of entering values into an excel sheet, we thought of using Visual Basic to create a front end form to input values(basically numerical values) which will get stored in specific cells of a excel sheet..
we wish to keep the excel sheets as a backend datasource and just have a front end form ..
using these inputted values .. the results( charts ) will get generated as it is getting generated currently .. at a later stage we also wish to plot the charts on VB forms ..
we are unsure as to which versions of VB and excel are compatible .. what drivers to use .. and how to proceed on this task ..
I hope i was able to put across my project details .. if any doubts please let me know..
Please guide,
Thanks..
Gauti..
|
|
|
|
|
Consider this ...
How about storing the data in a database like SQL-Server and use Excel for your charts and graphs ? Excel can access SQL datasources and you won't be tied so tightly.
Keep your data in a database and use whatever presentation / reporting system you like.
Keep these issues in mind:
1) backup
2) sharing data accross multiple users
3) performance / scalability
Take some time to consider this approach.
Good luck.
|
|
|
|
|
Thank you David.. this is great and exciting ..
We wish to keep excel sheets completely in the background.. i.e. we don't want to keep these excel sheets open while this application is running .. will the values stored in the database be automatically updated in the excel sheets ..??
I connected excel sheet and mysql database using the data->connection option .. but i am not sure if the values will get automatically updated without the excel sheets been kept open ..
Please suggest..
Thanks,
Gauti
|
|
|
|
|