|
Thanks everyone for all their help.
I have done the following code and it works. Hopefully this will be useful to others. All you need on your form is a Panel, Picture Box (this goes inside panel) and a button
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
picImage.Image = New Bitmap("c:\test.tif")
' Get the source bitmap.
Dim bmSource As New Bitmap(picImage.Image)
' Make a bitmap for the result.
Dim bmDestination As New Bitmap(
CInt(bmSource .Width / 8), _
CInt(bmSource .Height / 8))
' Make a Graphics object
Dim grDest As Graphics = Graphics.FromImage(bmDestination)
' Copy the source image into the destination bitmap.
grDest.DrawImage(bmSource, 0, 0, _
bmDestination.Width + 1, _
bmDestination.Height + 1)
' Display the result.
picDest.Image = bmDestination
End Sub
|
|
|
|
|
Hi,
I'm writing a small app that will retrieve the assembly version number of all assemblies in a particular folder.
To do this I'm loading each assembly into its own app domain, getting the info I need and then unloading the app domain. But this still leaves the assemblies locked - they are only unlocked when I exit the application. How can I get around this?
To be able to load each assembly in its own app domain my own application has to be running from the same location as the assembly. Is there any way around this?
The code I use is below:
<code>
Private Sub ListProjects(ByVal root As String)
Dim baseDirectory As New DirectoryInfo(root)
Dim assemblies As FileInfo() = baseDirectory.GetFiles("*.dll")
For Each fi As FileInfo In assemblies
Dim fileVersion As String = String.Empty
Dim assemblyVersion As String = String.Empty
Dim name As String = fi.Name
Dim path As String = fi.FullName
Dim appDomainName As String = name.Substring(0, name.LastIndexOf("."c))
If name.ToLower.EndsWith("vshost.exe") Then Continue For
Dim ad As System.AppDomain
Dim assem As System.Reflection.Assembly
ad = System.AppDomain.CreateDomain(appDomainName)
assem = ad.Load(System.Reflection.AssemblyName.GetAssemblyName(path))
fileVersion = GetFileVersion(assem)
assemblyVersion = GetAssemblyVersion(assem)
Debug.Print("App Domain = " & ad.FriendlyName)
Debug.Print("Assembly name = " & name
Debug.Print("File Version = " & fileVersion
Debug.Print("Assembly Version = " & assemblyVersion
Debug.Print("==========================================")
AppDomain.Unload(ad)
Next
End Sub
</code>
Thanks,
dlarkin77
|
|
|
|
|
How to use a button created in Maceomedia Dreamweaver, on a vb.net form
|
|
|
|
|
Is the button animated ? If not, just do a screen capture, save teh bitmap, and put it on the button.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
i develop a project that has a feature of sending sms message.. does any one here know how to implement this using vb.net 2005 and my mobile phone(Nokia N70)...
|
|
|
|
|
|
Does anyone know how can i play a MP3 file or other multimedia file?, because in the vb we can only play wav file
|
|
|
|
|
By using DirectShow or the Windows Media Player control.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Can someone tell me what's the sqlce connection string in vb.net environment?
I get the error as below:
Description:
Deployment and/or registration failed with error: 0x8973190e. Error writing file '%CSIDL_PROGRAM_FILES%\test\test.exe'. Error 0x80070020: The process cannot access the file because it is being used by another process.
File:
Device Connectivity Component
I had restarted my PC but the problem still there.
|
|
|
|
|
Hi all,
We have an aspx which show a list of crystalreports in pdf formats.Now user wants to print all of them at one GO.We are able to show all the PDF's in one PDF but when we give Print command it shows empty page.
So can we print the reports directly to the printer all at one go.Please help me with the coding.
"PLEASE HELP ME ITS VERY URGENT"
My code goes like this
Dim rArray(Rlist.Count + rList1.Count - 1, 1) As String
Dim counter As Integer
For counter = 0 To Rlist.Count - 1
Dim oneReportItem As ReportInfo = Rlist.Item(counter)
reportsArray(counter, 0) = oneReportItem.SchID
reportsArray(counter, 1) = oneReportItem.ReportID
Next counter
For counter = Rlist.Count To UBound(rArray, 1)
Dim oneReportItem As ReportInfo = RList1.Item(counter - Rlist.Count)
reportsArray(counter, 0) = oneReportItem.SchID
reportsArray(counter, 1) = oneReportItem.ReportID
Next counter
Session("reports") = reportsArray
Durga
|
|
|
|
|
I already have a connection for my project; how do I use the sql commandtext and define the connection without going through the conn = MS jet; path etc. If I have to do the conn = ms jet, path, etc. will I be opening another connection to the same database?
Thanks for your time. Scott
|
|
|
|
|
Hello Folks,
I am trying to overide my .net 2.0 DataGridView
I have a gird of 10x10 thus I have hundred cells in that grid. But for each cell I want to save three values. I have override my Treeview to save three values but cannot do the same for DataGridView component. Any Hints please
Umair
Umair Lateef
|
|
|
|
|
GWbasicProgrammer wrote: But for each cell I want to save three values
And those would be??? Each cell can only hold a single value or object, so you'll have to provide a bit more detail as to what your talking about.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
VS 2005 / Framework 2.0 allows you to store settings as User Settings and Application Settings replacing the older style App.Config in Framework 1.0. You can now publish your application and any updates can be forced to the end-user. Unfortunately when you publish the user settings that the client is able to change with my form and save, get wiped out to default. Also, if I setup Isolated Storage for the settings to be stored into, when I re-publish once the app has been in production for a while, it resets everything to default.
Am I missing something? Microsoft gives you the capabilities to store a users own settings for their app, but boom when you republish, the settings get reset to default.
Any insight is appreciated..
Lost in the vast sea of .NET
|
|
|
|
|
I had this same problem with an issue. I decided it was easier just to store my values (I only had a few) in the registry by user name.
Hope this helps.
|
|
|
|
|
In VB2005, how can I dinamically create a Timer inside a class without using the control. I suppose that I have to use the System.Timers.Timer class but I don't know how to handle the Elapsed event.
Thanks in advance,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Do you mean something like this?
Private Sub TimerForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Timer1 As New System.Timers.Timer()
AddHandler Timer1.Elapsed, AddressOf TimerEvent
End Sub
Private Shared Sub TimerEvent(source As Object, e As Timers.ElapsedEventArgs)
MsgBox("Hello World!")
End Sub
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Just declare it withevents. Example: Withevents tmr as new timer
|
|
|
|
|
Yep thanks, I missed the WithEvents modifier.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I've been trying to find the best way to load data from SQL into a DataGridView. Obviously I could just load it into a DataSet with a SqlDataAdapter and set the dataSource of the DGV to the DataSet, but i'm having issues because there are 120,000 records that need to be loaded, and this takes quite a while to load DataSet from the adapter. I guess this isn't an issue with the DGV, but loading the data into the dataset.
Nathan Lindley
|
|
|
|
|
Maybe you should only grab the number of records that you are going to display in the grid at a time?
|
|
|
|
|
Well i was going to have them be able to scroll through the list instead of forcing them to search for a specific set of records, but that seems to be the only way.
Thanks
Nathan Lindley
|
|
|
|
|
I guess my only other suggestions for making it faster are to make sure that you are selecting ONLY the columns that you absolutely need in the grid, and to do everything you can (in terms of formatting) in the SQL statement so that you do not have to loop through the records to format after you have retrieved them.
Good Luck.
|
|
|
|
|
Agree.
Thanks Again.
Nathan Lindley
|
|
|
|