|
whats me? in Me.datagrid1.Item(i,j) ?
i believe its the ID of the check box?
|
|
|
|
|
Me is nothing but the Form which contains the DataGrid. datagrid1 is the Datagrid object.
|
|
|
|
|
This is the code that I have (just learning)
<br />
If OpenFileDialog1.ShowDialog = DialogResult.OK Then<br />
Dim bitmap As New Bitmap(OpenFileDialog1.FileName)<br />
Dim gr As Graphics = Me.CreateGraphics<br />
gr.DrawImage(bitmap, 0, 0)<br />
bitmap.Dispose()<br />
gr.Dispose()<br />
End If<br />
the file open box work fine, but the picture does not appear. I am working from an example in a book, and that is what they have. What is it that is missing to make the bitmap visible in the form?
Thanks for the help.
|
|
|
|
|
Don't the Dispose calls mean you're deleting the bitmap ? Have you traced through the code ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I did try to remove the dispose method, but it still doesn't work. As for tracing through, do you mean just step through? I haven't done that because there isn't many lines of code, and it is copied from the book that I am reading. Unless tracing is totally different, in which case no
|
|
|
|
|
Were you to step through, you will be able to see if the Bitmap is loading properly, if the Graphics object is being created OK, etc.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
ya it seems that everything is being created just fine. Once again I remove the dispose methods, just in case, but still nothing. I tried this on a computer at work as well and I got the nothing displayed there as well
|
|
|
|
|
i did the other examples in the book, and this is the only one that I cannot seem to get to work, and this is really the only one that I need to get to work.
Any help is appreciated. Thanks
|
|
|
|
|
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
|
|
|
|