|
Hello,
Can someone give me some instructions along with some code on how to insert icons into a listbox so that icons are on the left and a string on the right.
Thank you,
Yoshi
|
|
|
|
|
Create an ImageList , then set the images that you want to appear in the ListBox. Then in the ListBox, set the Image Index (images set in the ImageList) to each item.
|
|
|
|
|
Thanks, if it helps I am using the same icon for all the items in the list box, need I use an image list still?
Can you please explain what do you mean by "Then in the listbox, set the image index(images set int the ImageList) to each item."
Thanks,
Yoshi
|
|
|
|
|
Sorry, I thought you were using a ListView, not a ListBox. You can try using a ListView for your project, it does pretty much the same thing, but with more options. And you cannot set images in a ListBox.
If you do use a ListView, open the Item Edit menu and for each item there will be an "Image Index" item, then just select the image you want (a list of all the images you have set in the ImageList will appear).
And yes you still need an ImageList even for a single image.
|
|
|
|
|
Hi , i have the following situation. I have a picturebox with a image in it (like a normal picture with a size of 48x48 pixel)
now i wanna paint a shadow to a given direction an strengt.
for example i say the light comes from left and the shadow should be right and 5 pixels big (something like the shadow functions in paintshop or photostudio)
the pictures are png's with alphachannel. how can i resolve the above problem ?
greetings
|
|
|
|
|
Shadowing the picture or the picture box?
|
|
|
|
|
Hi, the picture in the picturebox ..
|
|
|
|
|
Personally, I would create a new control where you can control the painting procedures. In this control I would of course have the property of the image to shadow. Then in the paint event I would first draw the shadow of the image using ControlPaint.DrawImageDisabled(...) and then draw the slightly displaced image overtop of the shadow using the g.DrawImage routine (g is the Graphics object of the paint routine). I'll try to look for some code from a project that I just created that paints a shadowed image and post it. I would not even consider using shadows with a picturebox, it can only lead to trouble.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi Thomas, did you already post the code ? or could you send it me by mail. many greetings martin
|
|
|
|
|
This code is in C#, but I am sure that it can easily be translated. This is code that is contained in a screen saver presentation that paints 3 random images with a random quote specified in a particular directory:
public void DrawRandomImage(Graphics g, Rectangle rect)<br />
{<br />
if (usedIndexes.Count > currentImageIndex && bitmaps.Count >0)<br />
{<br />
if (showEffects)<br />
ControlPaint.DrawImageDisabled(g, bitmaps[usedIndexes[currentImageIndex]], rect.X + 5, rect.Y + 5, Color.Transparent);<br />
g.DrawImage(bitmaps[usedIndexes[currentImageIndex]], rect);<br />
currentImageIndex++;<br />
if (currentImageIndex == 3)<br />
currentImageIndex = 0;<br />
}<br />
else<br />
g.FillRectangle(new SolidBrush(Color.Black), rect);<br />
}
The variable bitmaps is an array of bitmaps that were read in from a specified directory. Basically replace the entire array with one image if you so choose. The two key parts of this code is:
ControlPaint.DrawImageDisabled()
which will draw a grayscale image which then can be offsetted from the image drawn with the g.DrawImage .
If you need further explanation just ask. This explanation may seem a bit jumbled.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi, iam looking for a real transparent picturebox. i wanna have a picturebox (that, when i place it on a form or over another picturebox , the background is visible)
i there already out a solution ?
greetings
|
|
|
|
|
Have you tried
PictureBox1.BackColor = Color.Transparent
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
Yep , that was on of the first things i have tryed. but not with the result i want.
|
|
|
|
|
Could you take a screenshot of the result you got, and maybe post the code you used?
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
Hi,
I am looking for an efficient way to compare 2 versions of a file, extract the difference to a new file and be able to merge the new file with the differences into the original.
Any help would be greatly appreciated.
Regards,
Zeny
|
|
|
|
|
Try Beyond Compare from Scooter Software (www.scootersoftware.com). I find it indispensable.
Crispin
Crispin Horsfield
Caz Limited, Bristol, UK
+44 117 941 5920
www.caz.ltd.uk
|
|
|
|
|
Thanks but I was hoping to find a way to programatically do it in VB.NET.
|
|
|
|
|
Can anyone point me in the right direction to getting this type of file comparison done in vb.net?
thanks,
Zenly
|
|
|
|
|
Hi,
I have installed the windows SDK API methods, and want to use the method called markers in it, however it's not explained very well on how I can use there sample into my project. There sample is on audio, however i want to use that on my video, does anyone know how I can do this, or were i can go to get this?
Thanks.
|
|
|
|
|
Hi,
I have a Insert query in one of my Table Adapters (I removed the actual fields and values to shorten up the post).
INSERT INTO product (...) VALUES (...);
SELECT SCOPE_IDENTITY()
I have ExecuteMode property set to scalar so that when I execute this insert I am returned the new product id. Everything works fine unless I go back into the Configuration Wizard to make a change to the sql statement. At that point the ExecuteMode property is reset to NonQuery and I am returned the number of records effected instead of the new product id.
Does anyone know of a setting in Visual Studio I can change so that the ExecuteMode property does not revert back to NonQuery default whenever I make a change to the sql statement.
Thanks in Advance,
Jeff
|
|
|
|
|
Hi guys.I am Daniel from Ethiopia. I am new to this site.I developed a DBMS using VB 6.0 for some agency and when i try to install the setup program for this application, i get the following error message:
" Cannot start main setup program ( Create proces returned error code 0 x 000000C1H) "
Can any one tell me what might have caused this problem?
And before installing the setup program for the application i have developed, i formatted the PC because i tried the same set up program to install it before i formatted the PC and it worked.The only problem back then was that after it was successfully installed,, when i tried to login in to the program( becuase it has a login form), it displayed,
" Disk or Network Error"
I would relly appreciate if any body would help me out.
ASAP.
The freak dude is out!
|
|
|
|
|
Hi guys.I am Daniel from Ethiopia. I am new to this site.I developed a DBMS using VB 6.0 for some agency and when i try to install the setup program for this application, i get the following error message:
" Cannot start main setup program ( Create proces returned error code 0 x 000000C1H) "
Can any one tell me what might have caused this problem?
And before installing the setup program for the application i have developed, i formatted the PC because i tried the same set up program to install it before i formatted the PC and it worked.The only problem back then was that after it was successfully installed,, when i tried to login in to the program( becuase it has a login form), it displayed,
" Disk or Network Error"
I would relly appreciate if any body would help me out.
ASAP.
The freak dude is out! "
|
|
|
|
|
Hi Daniel,
I think it might be a good idea to first try and install your application on an entirely different PC. It sounds a little like there might be a problem with your hardware. See if the same error is thrown on another machine.
If that proves the bug is in the code after all, you could install the VB6 development environment on the target pc and run your code using the debugger, to see where the error happens.
Good luck,
Johan
|
|
|
|
|
Hi
If you use:
DataAdapter.FillSchema(dtTable, SchemaType.Source)
DataAdapter.Fill(dtTable)
... Add records to dtTable
DataAdapter.Update(dtTable)
Do ONLY the modified records get written back to the database, or will this command copy ALL the records back? (Basically what I am asking is: Is there any chance or "Wrecking" the original records that were in the database, or is it only the rows added that will be inserted)
Regards
Richard
|
|
|
|
|
If I'm not mistaken, you should be able to print out the .UpdateCommand property of the DataAdapter.
Jonathan Sampson
www.SampsonResume.com
|
|
|
|