|
Instead of using Form's Transparency key, use the MakeTransparent method of Bitmap class like this. It works fine.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim img As Bitmap = CType(Me.PictureBox1.Image, Bitmap)<br />
img.MakeTransparent(img.GetPixel(0, 0))<br />
End Sub
|
|
|
|
|
In VB.net could someone tell me how, if it is possible,to add icons next to a Menu item.
|
|
|
|
|
The MenuItem Class does not automatically support icons You have to set .OwnerDraw() property to true, and handle the MeasureItem (setting the size of the item) and DrawItem (drawing the item) events.
Instead of doing that for every MenuItem on your form, you can make a class inheriting from MenuItem, that automatically sets OwnerDraw to true, and draws the item with it's icon. Here is an example someone has posted to this site. Working with OwnerDraw Menus in VB.NET
|
|
|
|
|
i have created a vb .exe file which creates a mschart using mschart control utility .... i need to copy the output of mschart to .bmp without using clipboard... becoz it displays error "Can't open clipboard" ... also cleared clipboard before using it... but still no use... so i want to directly store the mschart into .bmp without using clipboard.... please help.....
|
|
|
|
|
Dear guys,
Good afternoon! We are currently using VB.NET as our programming language and MS SQL Server as our database. I just want to ask how can I save a database file using a VB.NET code and not the interface or functionalities of MS SQL Server?
Thanks... More power....
len_ems
|
|
|
|
|
len_ems wrote:
I just want to ask how can I save a database file using a VB.NET code and not the interface or functionalities of MS SQL Server?
This doesn't make any sense. Save what database file? SQL Server maintains it's own files completely isolated from your VB code.
Are you asking how you can create your own database file to maintain data in your app? Have you looked at XML?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If you mean saving the *.mdf file of the database to another location, try this:
<br />
dim source as string = path_to_mdf_file\*.mdf<br />
dim dest as string =path_to_copy_to\*.mdf<br />
'last parameter determines whether to overwrite an<br />
'existing file or not<br />
system.io.file.copy(source,dest,true)<br />
|
|
|
|
|
Good afternoon...
I'm sorry if my query is vague. I just want to save or backup my database or database file by using a VB.Net code. It's just like backuping a file to a destination. But I already found a code for that and it has a lot of features like : login to MS SQL Server; backup, restore and repair databases; upload and delete databases; checks connection; controls server; etc...
Thank you for your advices...
|
|
|
|
|
Ok, I am about at the end of my rope here. Been looking at this code for hours and can not see what is wrong with it.
I have an object saved to a file using Binary Serialization. The file has also been DES encrypted (it is a license file).
The problem get sall the way down to where I am deserializing the MemoryStream to my variable:
Private m_designtimeLicense As New DesigntimeLicenseToken
. . .
DataFile = New FileStream(filename.ToString, FileMode.Open, FileAccess.Read, FileShare.Read)
desCrypt.Key = arrKey
desCrypt.IV = arrVector
desDecrypt = desCrypt.CreateDecryptor
cryptoStream = New CryptoStream(DataFile, desDecrypt, CryptoStreamMode.Read)
arrHoldtxt = New BinaryReader(cryptoStream).ReadBytes(DataFile.Length)
MemoryStream = New MemoryStream(arrHoldtxt)
BinaryFormatter = New BinaryFormatter
MemoryStream.Position = 0
Select Case mode
Case ValidationType.Designtime
m_designtimeLicense = BinaryFormatter.Deserialize(MemoryStream)
Case ValidationType.Runtime
m_runtimeLicense = BinaryFormatter.Deserialize(MemoryStream)
End Select
BANG! The code dies right at the first case with InvalidCastException.
I KNOW this code works because I can use the EXACT SAME CODE to open the EXACT SAME FILE and display it in the application that I wrote to create the license files.
The DesigntimeLicenseToken object is a class that I have in a completely separate assembly (so the serialization works) and it has a static version (again to the serialization has no version related issues). It’s interface has not changed at all since I started the project so it can’t be related to that.
The other kicker here is that I use the EXACT SAME CODE to deserialize another object that I use for runtime license and it works NO PROBLEM!
This code only has a problem when it is part of the constructor of a Usercontrol and gets run when I drag a copy of the Usercontrol onto a form, so it is running with the IDE in design time mode making it a PITA to debug.
Does anyone have any ideas?
I checked the types of both the variable (m_designtimeLicense) and the memory stream being deserialized and they are the same. At least they have the same full name so I have to assume that they are the same.
If I deserialize to a generic object:
Dim obj As Object
obj = BinaryFormatter.Deserialize(MemoryStream)
It does not complain. That seems really odd to me. If I then try to convert obj to DesigntimeLicenseToken the cast fails again.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
Hmmmmm... I go back to it today and now it is working....
This is REALLY odd.... and disturbing...
Could I have had a chaced copy of the memorystream sitting somewhere?
UGH!
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
I wanna create like google tool bar, or Yahoo tool bar
which is add-on to the IE. What Visual Basic technology
do I have to use?
|
|
|
|
|
It's not based in any "VB.NET technology". You'll be building a COM object using VB.NET or C#.NET. Checkout this[^] article on CodeProject. It's written in C#, but is convertable to VB.NET easy enough.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have been writing a COM Add-In for Outlook using VB.NET. Now late in the game, it will no longer load when outlook loads. The connect event is never triggered. The .NET IDE gives the following hint:
' When run, the Add-in wizard prepared the registry for the Add-in.
' At a later time, if the Add-in becomes unavailable for reasons such as:
' 1) You moved this project to a computer other than which is was originally created on.
' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
' 3) Registry corruption.
' you will need to re-register the Add-in by building the MyAddin1Setup project by right clicking the project in the Solution Explorer, then choosing install.
I have tried their solution several times to no avail. Does anyone know how I can troubleshoot/resolve this problem. Needless to say its making me crazy!
Thanks in advance!
J. Rich
|
|
|
|
|
I think you are talking about the same problem I had. Though I dont understand why, what I did was in Connect.vb OnConnection method, I commented out 'If' condition. This just works as I wanted.
Bhaskara
|
|
|
|
|
I wish this worked for me. But no luck here.
In fact I have a msgbox statement as you enter the OnConnect event. But the OnConnect event never seems to fire. It does not appear that Outlook is opening the Add-In and thus the OnConnect event never occurs. My current theory is something is wrong in the Registry...but I have NO idea what or how...
From the information gravel road
|
|
|
|
|
try this
add a setup project to the add-in app and install the application and see. it should work.
|
|
|
|
|
Got it finally...FYI....
If you declare and initialize an object in the Connect Class declaration section(eg. Dim myObject as Object = Object), the Add-In will not connect(I think Outlook loads in "safe mode") and no error condition will be thrown.
Of course it was easy enough to declare the object in the in the declaration section and instantiate it after connection happens, and this was my solution....
Hope this helps someone else, cause this made me crazy for several days!
JRich
|
|
|
|
|
Hi.
Does anybody know if it is possible to ‘pan’ a PictureBox?
Thanks.
Brad
|
|
|
|
|
If you are meaning like scrolling around, try putting one in a panel and setting the panel's .AutoScroll() Property to true.
Hope this helps
|
|
|
|
|
Actually what I would like to do is a Pan similar to what a lot of drawing packages like AutoCAD have...left click and hold while dragging the image around the viewer. This is a very handy option when the picture is zoomed in very close.
Thanks
Brad
|
|
|
|
|
I am making a application which plays tracks from a listboxcontrol
with the windows media player active x control (OCX). The items in the
listbox are the paths to the sound files.
The problem is that when I start playing a track, the very
beginging of the track gets cut off, this is only a fraction of a
second but it is still bad.
Any sugestions?
Many Thanks,
Glen Conaway
|
|
|
|
|
i want to developed server application
Which gets time from user let suppose 8'O clock in morning and then start seasrching database for changes and takes appropriate actions
thansk
regdrs
|
|
|
|
|
Permission granted!
I take it, there's a question buried in there somewhere...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well i mean
how i create Application as we see in Antivirus programs to Schedule scan time and other timing
thanks
|
|
|
|
|
All you have to do is write your application as a stand alone app that quits on its own. Then just use the Scheduled Tasks control panel to run it on at a scheduled time as often as you want.
Or you could make it more complex by building a scheduler into your app. You'd use a timer to fire off a method that gets the current system time and compares it to, maybe, a list of scheduled tasks that it needs to perform. If the time is right, you would have to launch the appropriate tasks. If not, the method just exists and waits for the next tick of the timer, say, every 10 seconds. My first thought is a scheduler that launches each task in a seperate thread. You would then need an interface to manage the task list and another one to manage the scheduler.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|