|
Well, your trying to paint a picture as the background of a form. When the form is painted, your picture is being painted, but then it is painted over by the BackgroundColor and then the BackgroundImage. Your picture will never be seen. Change the code a little bit and it'll work:
If OpenFileDialog1.ShowDialog = DialogResult.OK Then
Dim bitmap As New Bitmap(OpenFileDialog1.FileName)
'Dim gr As Graphics = Me.CreateGraphics
'gr.DrawImage(bitmap, 0, 0)
Me.BackgroundImage = bitmap
'bitmap.Dispose()
'gr.Dispose()
End If
RageInTheMachine9532
|
|
|
|
|
Hey that worked!
Actually it worked when opening a gif file, but when I tried to open a tif file that is quite a bit larger, it crashed.
<br />
An unhandled exception of type 'System.ArgumentException' occurred in system.drawing.dll<br />
<br />
Additional information: Invalid parameter used. <br />
What I am trying to do is place a tif file in the bg, extract the meta tag data and overlay the image with a number of semi-transparent boxes that highlight lertain areas, that when clicked will then display the meta-data that was within the tag for the box that was clicked.
Is the GDI+ the best thing to use for this?
|
|
|
|
|
kowplunk wrote:
but when I tried to open a tif file that is quite a bit larger, it crashed.
Ewww... Ummm...TIF files aren't a good candidate for a background image simply because of their size compared to, say a BMP file of the same image. Comparing the two, it takes quite a bit more time to render a tif file, especially when your moving and resizing the form and such like. A better solution would be to convert the file to a BMP or JPG file and use that for the background instead. The performance gain will be noticable over usin a TIF. You'll also get over the problem you ran into with the exception being thrown.
RageInTheMachine9532
|
|
|
|
|
ok, I will look for a way to do the conversion, I assume that vb.net provides something. Unfortunately that is the only way that I can do this since the tif images are from a scanner that is doing a number of batch jobs and the data in the meta tags is what the whole program is based on.
I can open the tif files with the kodak classes, and things work pretty good, but I cannot figure out how to scale the images to a smaller size. Sounds silly, but alot the width, length and scale properties are readonly and the zoom property is a short numeric type, so zooming in is fine, but zooming out is difficult.
|
|
|
|
|
Hello,
I am trying to change the color of a single column header in a datagrid. It is quite easy to change the headerforecolor for the entire grid by I have not found a way to change the color of a single header.
Thanks,
Antonio
|
|
|
|
|
Use some logic to find the co-ordinates of the rectangle for the Column header and then use the Paint method to draw a new color on it like this.
private void dataGrid1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.FillRectangle(SystemBrushes.ControlDarkDark, 0, 0, 20, 20);
}
|
|
|
|
|
Hi,
How can I create a frame on a from by using a code and not just by dragging it or double-clicking on its icon? For example: If I click the command button create from a form, it should create a frame on another form and must not disappear once I unload both forms.
Thanks
|
|
|
|
|
gen23 wrote:
it should create a frame on another form and must not disappear once I unload both forms.
When you create the frame control, you add it to the Controls collection of the form. When you unload the form, the controls colleciton goes away, and the frame with it. You'll have to re-add the frame control to the form when you create a new instance of the form.
RageInTheMachine9532
|
|
|
|
|
Hi All,
I have written a little POP3 Email client to retrieve mail from an email address, with the intention of pulling mail, parsing it and logging it in a DB. Problem is, the mail retrieval comes through MIME mail encoded (Text), The emails are multipart and I therefore need to consolidate the email in a format where I can display the HTML and any attatchments. Short of rewriting the MIME RFC specs does anyone know of a way I can get the mail into a parsable format. Or better still store the info in the .NET System.Web.Mail.MailSessage format.
Any Help???
Thanx
Greg
|
|
|
|
|
Hi there,
I have the problem to read German umlaut (ä,ö,ü,...) with the xml-reader.
Dim xmlRead As New XmlTextReader(strXMLPath)
In my loop...
Do While xmlRead.Read
...
Loop
I'll always got an exception while reading the line with the umlaut.
Does anyone has a tip for me??
Thanx
Erik
|
|
|
|
|
Okay,
I have a program that I am working on in VB.net.
I need to use Excel to pull in data from particular cells into a text box.
Any help would be appreciated.
Actually, I am in need of some one to actually help me do the database thing.
Its simple. (I just don't have the knowledge and I got thrust into this)
MSN has a stock qoute feed that you can set up with any symbol(-MSN-GE-IBM-MSFT) I am trying to use Excel as my database.
When I type in IBM into the search field I would like the data to populate into 5 seperate text boxes (Ask price-Ask Size-Bid Price-Bid Size-Volume)
Again, any help would be appreciated. I work for a small (5 people) finance company and I am the tech guy.. I am fine with building PC's and doing software installations but this is a little beyond me.
thanks!!
Kevin Sewell
Looking for a few good programmers
|
|
|
|
|
Send me some more details to richardgrimmer@hotmail.com, and would be glad to help - that sort of thing is pretty much my "bread and butter" at the moment!!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
My application creates an Excel Spreadsheet and fills it with data and formulas. Excel is not visible while the program is running and is made visible at the end. there are no "ScreenUpdate = False (or True) statements in the code. It runs fine in windows XP Professional and Windows 98 2nd Ed. However, when it is run on windows 2000, the excel screen fails to update properly. there are "legacy" images from the VB.Net forms on the Excel screen. The screen resolution on the Win 200 machine is 1024 X 768. The resolution on the XP machine is 1280 X 1024, and 1024 X 768 on the Win98 machine.
I have no idea what the proble m might be, Does anyone have any ideas?
|
|
|
|
|
You might want to try updating the video drivers first...
RageInTheMachine9532
|
|
|
|
|
I tried updating the driver and found that the most current version is already installed.
What next?
Thanks!
|
|
|
|
|
Short of replacing the video card with something else and testing it, I don't know what to tell you. If definately sounds like a driver problem though. Even if the drivers are current, it doesn't mean they're perfect.
RageInTheMachine9532
|
|
|
|
|
Greetings
We are exporting Microsoft Outlook mail folders in to text files. We then are pulling them in to the application where they muct be displayed on the screen in a list. They are supposed to be tab delimited. I try to replace chr(13) with " " in the filestream and it is not working. I have looked at the text files and they have a little box that separates each email address. Yet, I do not seem to be able to find the correct ASCII character that is this box.
I have tried char(9), char(10), chr(11), char(13), vbcrlf, environment.newline, you name it. I cannot get it to break.
Does this make any sense? Let me know if you have the answer.
Rob
Does
Rob Taylor
www.tconsult.com
|
|
|
|
|
That little box is a generic character symbol. It can be used many, many, MANY times in a font. You can't just look at that box symbol and identify the correct character code. It can change from font to font. You can find out what the character is by loading the string into a String variable and then look at the chars array of the String variable to ID the code of the character.
RageInTheMachine9532
|
|
|
|
|
A StatusBar on my main form has been quite happy sitting at the bottom of the form for several months now but today it just got up and moved so it is somewhere else on my form, somewhere I don't want it. I have a lot of docking windows on there and it has snuggled in with them. How do I get it to go back to the bottom of the form? I can't drag it there, I can't cut and repaste it.
Is there anything I can edit or do to get it back there?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hey all,
i am trying to include a small webserver in one of my application,
so far i have found a very nice example, but it is in c#
i've been trying to convert it, but i always hit the same error(to many to sum up)
i'm talking about:
http://www.codeproject.com/Purgatory/webservergui.asp
if any one has converted it or know a vb.net variant.
can you post a link?
Thanx in advance
Jorge
|
|
|
|
|
Dear friends, i wanted to know that how can i write code behind toolbar panels.. when eevr i double click on toolbar it takes me to buttonclick event of toolbar.. but how can i code behind the buttons i placed upon toolbar?
|
|
|
|
|
When you click on a toolbar, the toolbar's ButtonClick event is fired and the button that was click is passed in ToolBarButtonClickEventArgs - its button property contains the index of the button (from the Buttons collection).
You could deal with it using a: Select Case yourToolBarName.Buttons.IndexOf (e.Button) for example.
|
|
|
|
|
thank you sir with this help.. but do i always need to use Select Case for dealing with Buttons of ToolBar.. can you please send me a lil code snipper for this..
thank you
|
|
|
|
|
No, you could use If...End If.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmSelectCase.asp
I've assumed an Open button, a Save button and a SaveAs button. For the Open button, I've pointed it at what might be the routine you've already written to handle a traditional menu item called mnuFileOpen.
Select Case toolbar.Buttons.IndexOf(e.button)
Case 0
mnuFileOpen_Click(Nothing, Nothing)
Case 1
SaveFile()
Case 2
SaveFileAs()
Case Else ' Other values.
'Since you should know how many buttons you've got, you shouldn't
'need a Case Else.
End Select
Don't forget that if you've used separators, they'll be on this list. E.g. If you have a separator after the Open button, you should code:
Case 1
Case 2
SaveFile()
etc.
|
|
|
|
|
i instantly need a code , in VB.NET, that ACTUALLY RUNS for uploading files to the hard drive.
theres an article by manoj rajan , on uploading files using VB.NET.
its a 4-5 lines of code and it just doesnt work.
so any instant help in this regard?
Plz reply SOON
|
|
|
|