.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to check for Panel background images?

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :Windows Application
Hi guys, I need your help. I am writing the code on the panel click event that if the image is called testimagesred, then displaying the messagebox.   Private Sub Panel1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Panel1.Click         If Panel1.BackgroundImage Is My.Resources.Resources.testimagesred Then MessageBox.Show("the images shown as red") ElseIf Panel1.BackgroundImage Is My.Resources.Resources.testimagesgreen Then MessageBox.Show("the images shown as green") End If End Sub When I click on the panel, the messagebox doesn't display when the images are on testimagesred.   Any idea?

View Complete Post

More Related Resource Links

Form background images and memory usage

Hello everyone, please forgive me if this is the wrong forum for this post. I have written a Windows App in C#. It's a real small application (something like a widget) that stays on your desktop and shows pictures of a folder in a random sequence. Before showing another picture i use : this.BackgroundImage.Dispose(); so that i keep memory usage low. If i won't do that i can see memory rising (depends on the image size). Now the code i use to change the picture is : this.BackgroundImage = Image.FromFile(path, true); So my question is about this last line of code. Is this a good approach of changing the picture after a while? (this code runs in a loop) Should i care about memory usage? The form is a small one for this kind of app, so loading big and large pictures can have some issues i guess. I have been monitoring my app for some time , memory and cpu usage were really low but i would like to know another and better approach on this one if somoeone knows.  de_Stan

I am using the following code to check to see if a panel is visible or not before running javascript

Using VB, VS 2010, when I run the following code, I get an error because it executes the code even if I have Panel7 set to invisible.  I am trying to use javascript to see if the panel is visible or not before executing the code.var panelRef7 = document.getElementById('<%= Panel7.ClientID %>'); if (panelRef7) { $find('DragP7').add move(savePanelPosition); }  What am I doing wrong?   Thanks

How to make background-image of table or panel Rounded ?

Hi, I have taken background-image of a Table and Panel, that image's corner is rectangula. How can i make its corners Rounded ? I searched some online resources, images were made rounded, how to make make background-image rounded on the fly ? 

HTML Editor: Change Edit Panel Background Color

I've created a custom editor from the default AJAX HTMLEditor control to limit the toolbar buttons, etc. But I can't see how to set the background color of the text area in design mode. I'd like to set the background color to something other than white, because with my app most users will want to use white as their text color. White text on a white background is no bueno. The editor has ForeColor and BackColor properties, but these values don't control the text area. I tried creating custom css styles based on Editor.css, but all I end up with is an HTMLEditor without a border. Am I approaching this wrong? Any suggestions?

Div background images not rendering

I'm new building a website.  I just started testing my website with other browsers, and I've noticed the background image for my DIV elements isn't rendering in either  Mozilla Firefox or Google Chrome.  It didn't even render in Explorer on a different computer.  I had to create an image element and draw it behind my content to make a background image.  I'm hardly doing anything more exotic than:    tag  div id="hdr style="width: 625px; height: 58px; background-image: url('file:///C:/__path__/MyImage.bmp'); background-repeat: repeat-x;" close-tag  I now have it rendering properly in all 3 browsers as an image object with content positioned over it.

Embedding CSS with Background Images



I have  a new control in which I have successfuly embedded some javascript to the assembly as a WebResource as well as a CSS file which has background images.  I cannot get the image files referenced by the CSS to render. Is this possible?

I have entered some of the images as Web resources and embedded them but they still are not rendering.

Any help much appreciated.



Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.

Images in WPF

How to create a Thumbnail of an Image. How to automatically crop an image. The following method allows you to automatically crop an image to it's content.

Reading and Writing Images From a Windows Mobile Database using UltraLite 10(C#)

Periodically I get a request for information on how to read and write binary data to a database running on Windows Mobile. If you search the Internet you can typically find examples that are available on Windows Desktops or allow you to read and write to a local file system. The problem is that it can take a bit of work to get this code to work on Windows Mobile accessing a database.

Ultimately you might be asking, why would I want to store and image in a database? Well in an environment where you synchronizing data between a local mobile database and a consolidated (central) database this can be extremely useful. Imagine if an insurance adjuster went to an accident scene, took a picture of a damaged car, loaded it into his Windows Mobile database and then replicated that image up to the Insurance headquarters for approval. All of this could be done in a very short period of time when using images in the database. Another good example might be a doctor who was waiting for a patient chart to become available. If you could store the image in a database this chart could be sent down to the doctor's device once it became available.

For this article I am not going to get into how to synchronize the images to and from a remote and central database as this is typically fairly straightforward when using a data synchronization technologies like MobiLink

Save images to SQL CE

Storing binary objects (such as image, office document etc.) into database is a little cumbersome when it comes to retrieval. Hence the most commonly accepted way is only store the file path in the database, and to store the documents on a file share.

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

Open File Print File Excel

Batch print many Excel files without having to open each one at a time. Quickly print mass amounts of xls files at once with this program. You must have Excel installed on your machine..

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:

check box control


Hi ,

I have a three check box in my web form ,i need to choose only one check box, if i choose one check box

another 2 check box automatically unchecked

can i use jquery for check box

Alternating row background for first column of a report


is there a way to make the first column of a report use the an alternating background color? 

I have the background color set for the entire row however it does not work for the first column if the color is set to an expression.  If I just set it to a color i.e. red it works just fine. If I insert a dummy column to the left it works just fine (but the dummy column does not work, presumably because it is first??).

In the file below only the textbox for part number does not show an alternating background.  All others work correctly.

                    <Textbox Name="PartNumber">

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend