VS 2008 Why Aren't Controls Drawn Transparently

Jun 3, 2010

If you make a Control's BackgroundColor Transparent and put it in front of another control, the other control doesn't show through. Why not? GDI+ makes this easy, doesn't it? Why don't Windows Forms use it?

View 10 Replies


ADVERTISEMENT

VS 2008 MSChart - Chart Area Axis's Aren't Drawn When No Data Plotted

Apr 2, 2009

MS released the new MSChart for .net 3.5 sp1. I'm trying to get the hang of it in VS2008. One big issue I have is that if I have no data plotted the chart area axis's aren't drawn. Does anyone know a way around that? That seems like a pretty basic/common issue.

View 6 Replies

VS 2008 Clear A Rectangle Drawn?

Aug 25, 2009

So; I've drawn this rectangle vb Dim zr As New Rectangle(100, 100, 100, 100)e.Graphics.DrawRectangle(Pens.Red, zr)

View 4 Replies

VS 2008 Creating An Owner Drawn Datetimepicker

Oct 24, 2010

how would i go about creating an ownerdrawn dtp, with highlighted dates in the dropdown + also in the collapsed view when a highlighted date is selected? i'm guessing i'd have to inherit a dtp + then handle an event or 2. does anyone have any insight or experience with this?

View 2 Replies

VS 2008 Drag And Drop Drawn Letters?

Sep 11, 2009

1) Draw three letter's 'P' 'B' & 'C' on a form (at a later date mutiples of each wil be added)

2) to be able to drag them anywhere on the form

3) to be able to lassoo them and drag them all at the same time.

For the moment the third option isn't important just as long as l can drag the letters.

View 13 Replies

VS 2008 Owner Drawn Combobox The Border?

Jan 26, 2011

Ok so i have an owner drawn combobox and everything is fine in the drawitem event,except i'm a perfectionist and there is no border i have a beige backcolor, and i really just want a black border or something first i tried to draw using the given graphics and the given bounds, it failed as the rectangle was drawn oddly inside the combobox for some reason (not on the inner border, almost in the center of the combobox.then i tried the following and was surprised when it didnt work

Dim z2fx As Graphics = Graphics.FromHwnd(cmbBox.Handle)
z2fx.DrawRectangle(Pens.Black, New Rectangle(0, 0, cmbBox.Width, cmbBox.Height))

then i tried this and thought for sure it would work

1 Dim zfx As Graphics = Graphics.FromHwnd(cmbBox.Parent.Handle)
zfx.DrawRectangle(Pens.Black, cmbBox.Bounds)

this drew 2 sides of the border, the bottom and the right then i realized something: the code i used earlier with z2fx made the upper and left borders flicker right when i click the drop down, then it goes away. It is as if they were being redrawn with the background color of the combobox. And this redrawing was taking place after the drawitem event was called.

Something, some event, keeps redrawing the background color of the combobox when i put a button on the form and associate it with the zfx2 code, then when i press this button the combobox draws the 2 borders (upper and left) and they stay drawn until i either hover over the combobox or open the drop down of the combobox.

nvm while typing this i figured out a solution i can use the mouseenter mouseleave and dropdown events

since i typed this already im posting it anyway if i have problems i will let you know.EDIT: failed.SOMETHING keeps redrawing the damn background only after most events have passed! i tried the backgroundcolorchanged event it didnt work. this is annoying.

View 1 Replies

VS 2008 Saving Lines Drawn In Pictureboxes

Aug 21, 2010

On my form, I have a picture box that starts off blank, but draws lines according to mouse click events.

I am now trying to test whether there is colour in individual pixels, yet I am yet to find solid code.

My initial code was along the lines of

Dim bitm as bitmap
bitm = PictureBox1.Image

This would come up with nothing, as there wasn't any image assigned to the picture box.

I was wondering how I could save the lines drawn and use that as a bitmap to test pixel colour.

View 4 Replies

VS 2008 Creating A User-drawn Listbox Class?

Aug 1, 2009

having trouble trying to add different items to the listbox. What happens is that the item that's in the listbox gets redrawn every time I try to add new item, why is that?

vb.net
Public Class ColoredListBox
Inherits System.Windows.Forms.ListBox

[code]....

View 10 Replies

VS 2008 Hide Images Drawn In A Picturebox By E.graphics?

Dec 25, 2009

I have an application that has a list of point and I can choose a tool and draw one image to different locations then remove them if I wish, and when I finish editing those images, I can then pick another tool . The images are supposed to go away that were drawn by e.graphics but they only do when I click in the picturebox. How can I hide the images or delete them from graphics when I choose another imageHere's the paint event alone

vb
Private Sub MapGrid_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MapGrid.Paint

[code].....

View 6 Replies

[2008] Custom Icon In Owner-drawn ListView

Feb 1, 2009

I created an image (.png) with a transparent background and I'm trying to show it in a ListView. So I added the image to the ImageList belonging to the ListView, however when drawn, there is a partial white circle around the image. I checked and rechecked the actual image and there are absolutely NO white pixels at those positions.

[Code]...

View 3 Replies

VS 2008 Create An Owner Drawn TabControl That Looks Like The Tabs In Visual Studio On XP?

Jul 8, 2009

I'm trying to create an owner drawn TabControl that looks like the tabs in Visual Studio on XP (might look different in Vista, not so sure).So far, I've got the background and the blueish border, and now I've run into some trouble drawing the 'tab headers' (where the text is displayed).Here's what I got so far:

vb.net
Imports System.Drawing.Drawing2D
Public Class cTabControl
#Region " Colors "

[code]....

Why isn't this working? How do I draw a border like this around a 'normal' OwnerDrawn tabcontrol, without the funky SetStyle method..?also, the DoubleBuffer ControlStyle (in the SetStyles method) option is not listed in the Intellisense list, but it is accepted when I finish typing it... Is that a bug?

View 21 Replies

Delete Some Files But Only If They Aren't In Use?

Nov 23, 2009

i want to delete some files but only if they aren't in use. What i did was a try/catch:

Try
My.Computer.FileSystem.DeleteFile(fileInfo.FullName)
Catch ex As Exception
End Try

but it seems that this method is very slow if i try to delete some files over network.

Is there an faster way to delete files? Is it faster to check first if an file is open? If yes, how can i check if an file is open?

View 5 Replies

Settings AREN'T Saved?

Apr 9, 2010

I have about 10 settings in my app which are set during coding, but the user can change them during the running of the app. They should then be saved so the same settings are there the next time the program is run.

View 1 Replies

Compare 2 Datasets That Aren't Identical?

Jun 5, 2011

I've just about scrambled my brain on this, searching and trying things, so I'm hoping someone sees something that I'm missing or can explain it to me. I'm new to .NET, used to do a lot of programming in VB but that was many years ago.

[Code]...

View 1 Replies

Way To Select From A List - Aren't The Two Listboxes Getting A Little Old?

Dec 22, 2009

How many times have we seen this type of selector:

I was just about to start creating this in a WinForms app, when I thought that others may have some ideas for doing this better. We need it to sort - so the right hand list will need up/down buttons. But this seems so old school. I love devexpress components, and was thinking of asking them if they would consider adding a component that handles this functionality with a slick UI.

I am thinking that a graphical representation of the objects, and a graphical representation of the listboxes - that would be a more intuitive way to move items around. Has anyone seen an open source project like this?

View 4 Replies

ASP Files On Windows 7 Aren't Loaded Even Though Installed IIS?

Jun 5, 2011

I don't know how to get my asp code to work on windows 7. I ran my project, it works correctly.

But for some pages I'm getting an HTTP 401.5 error.

View 1 Replies

C# - Aren't Short Circuited Operators The Default?

Feb 5, 2012

Given that a typical coding mantra is "Don't induce side effects in method calls." and that the only reason (that I know off - please enlighten me if I'm wrong) to not use short circuited operators is when you depend on the side effects of a method call in subsequent code. Why isn't the default operator in languages like C# and VB.NET not a short circuited version?

[Code]...

View 1 Replies

My Programs Aren't Playing Background Audio

Nov 12, 2010

Right now I'm trying to make an alarm clock program.I know my coding is correct and I'm not geting errors. Also my sound is a .Wav and was properly inserted into the resources folder. I was wondering if there is just some dumb setting that needs to be changed or if I'm forgeting something in the code.[code]...

View 4 Replies

Prevent Warnings On Variables Which Aren't Assigned A Value In A Try

Dec 22, 2010

I found some code on the internet as below (slightly modified).It simply requests the content of a webpage.However I get two warnings:

Warning 1 Variable 'srRead' is used before it has been assigned a value. A null reference exception could result at runtime.

Warning 2 Variable 'Str' is used before it has been assigned a value. A null reference exception could result at runtime.

I know I can simply forget about the Finally and add the code to the try block.Will that be the way to go or can I prevent the warnings using a different approach?

View 2 Replies

VS 2005 : BitBlt From Windows That Aren't Visible

Mar 9, 2010

I'm using BitBlt and GetDC to capture windows and save them to a bitmap, but a window that is covered or overlapped by another window appears with that window showing over top of it. Is there a way to stop this from happening? I have the window handle available, the graphics context, and a Process object.

View 5 Replies

C# - Why Aren't Code Regions Allowed Within Method Bodies In .NET

Jun 30, 2010

I'm refactoring VB.NET code where methods routinely run five hundred lines and the references are so tightly coupled that the code defies simple refactoring such as method extraction. And that's why I thought I would try regions within a method body. I just wanted to organize the code for the short term. But the IDE didn't let me (resulted in a compiler error.) I'm just curious as to why? Seems like code regions shouldn't impact the compiler, intellisense etc. Am I missing something? (Still using VS 2005 btw.)

Interesting: This seems to be language specific. It's OK in C# (I didn't check that initially) but not in VB.NET.

public module MyModule
Sub RunSnippet()
dim a as A = new A (Int32.MaxValue )

[code]....

that gets a compiler error but the C# version is ok.

View 5 Replies

IDE :: Changes I'm Making To My Code File Aren't Taking Effect?

Oct 26, 2009

I'm developing a Windows Service, but for some reason, the changes I'm making to my code file aren't taking effect. I clean, build, and rebuild the solution as well as all the files that I'm changing, but nothing's happening.Is this a problem with the installation of the service, or something wrong with my IDE? I just now thought that maybe I shouldn't be rebuilding the files...

View 11 Replies

Stop Program From Writing To A File When Certain Conditions Aren't Met?

Dec 11, 2011

I am building an application that accepts input entered into textboxes, then checks the input for negative values, etc. before writing it to a file. If the data does not meet the conditions, a message box pops up letting the user know. The problem I am having is that after it checks the data and displays the message box, it continues to save the input to the file anyway. How do I make it only write to the file if all the data meets my conditions?

View 1 Replies

VS 2008 Loop Through Controls Doesn't Get All Controls?

Jan 21, 2011

I am rather irritated at this. I have no clue why looping through controls on a form and in groupboxes leaves out 75% of the controls.

Here's the code I have:

Dim settings As String = ""
Dim gbControl As Control
Dim gbbox As Control

[Code]....

I want to have setting save all settings to an ini file, and not have to reprogram the saving routine when I add a group box or control. At random times, any number of controls can be disabled, checkboxes can be checked and unchecked, radiobuttons can be checked and unchecked. Regardless of the state of the control, I want the control to show up in the loop. But they don't. Only controls that are enabled and only checkboxes that are checked, every other control state is ignored. That's crap, and is definitely not what is needed by any programmer of any type. We're capable of determining if a control is enabled, hidden, checked, visible, and otherwise.

How do I get the controls to be included in the loop regardless of their state?

View 8 Replies

Code To Convert .doc To .xlsx - Underlined Words Aren't Declared

Feb 10, 2012

Option Explicit On
Imports System
Imports Microsoft.VisualBasic
Partial Public Class _Default

[code]....

I am getting error in the sheets and iffset liness.. it says

Sheets("Sheet1").Cells.SpecialCells(xlCellTypeLastCell)Offset(1, 1).End(xlToLeft).PasteSpecial(xlPasteValues), underlined words aren't declared

View 3 Replies

DotNET Stock Settings Sucks - Custom Solutions Aren't Much Better?

Oct 28, 2010

So I've been working with DotNET for a few years now; long enough to establish solid preferences for one available element over another, one available logic over another, and then to develop preferences for aspects of elements and logics.

The one that conflicts me the most is the stock Settings construct. It's a great idea - I mean everybody needs basic data persistence that isn't worthy of databasing, right? It's implemented in a way that anybody - and I mean anybody from flat beginner to highly advanced - can benefit from it. It does some heinously stupid stuff, though; for example, it angers me (and I mean full-on, where's my crowbar-OK-now where's the silly @#*! who came up with the idea anger) that the only way to save it is the way that's hardcoded in. The .SAVE method takes no parameters, there's absolutely zero exposure for the save-path to provide a more deliberate location, so the only place any settings ever get saved is in a ridiculously long (and literally arbitrarily designated) user-profile-based path.

So what happens if/when a user is ready to upgrade their OS (or just reformat and reinstall their OS, which the kinds of people who end up on my client list are prone to do just as part of quarterly maintenance), and they want to save their personal application settings to load in the next time around? They either have to hunt out that moronically obfuscatory save location or I have to write special (and I mean riding the short-short-short bus special) code which is more or less a whole new settings class identical to the settings classes implemented in the application to begin with, just to allow them to export their settings to a known location for transfer.

And what happens if a specific setting needs special treatment beyond the basic 'changing' and 'changed' events provided by the stock class? Since any change to the Settings Designer rewrites the whole code-behind property declarations, I can't do it in that code file; I either have to extend the Settings class or get back on the short-short-short bus and write that special 'mirror-class' again.

I'm not much for just general whining though, so some time back I wrote my own serializable classes (designed for specific data persistence, like generic/universal application settings and then also MySQL server connections/credentials and then also form properties and then also application-specific settings) along with shared save and load methods which give me more control over where settings get saved. These classes have evolved over the last year or so until they're actually pretty awesome (even if that's
just my opinion)... I've even implemented full on-disk and in-memory encryption functions for applications that need different privilege levels, to prevent any tampering at any time.

And then a multi-user application project comes along and suddenly each individual settings class needs multi-user support based on the Windows user logged in, and suddenly the stock Settings class is the best option again even though it's still the worst possible option in settings persistence.

So what I want to know from this discussion is this:

How do YOU handle application and user-settings persistence? Is there something really key that I've been missing all this time that makes the stock Settings class more than absolutely worthless (which has been my opinion since about the first time I ever had to work with it)?It never hurts to try. In a worst case scenario, you'll learn from it.

View 1 Replies

Record Aren't Showing - DataGridView1 Does Not Show The Data On My Testdb.mdb

Dec 15, 2011

My DataGridView1 does not show the data on my testdb.mdb i need to fix this first before i continue on adding records on my db.

Imports System.Data.OleDb

Public Class Customer

Dim con As OleDbConnection

[CODE]...

View 1 Replies

Handle Property Mappings To Other Domain Classes That Aren't Yet Mapped With NHibernate?

Sep 8, 2010

I'm working on a project to replace ADO.NET data access logic using NHibernate where we're not able to map the entire domain model at once. This means we'll have domain classes with property mappings to other domain classes that aren't yet mapped with NHibernate.

Consider a Person class with an Address property (Address being a domain object without an NH mapping and Person being the class I'm mapping). How can I include Address in the Person mapping without creating an entire mapping for Address? Is it possible to call legacy (ADO.NET) data access logic from a custom PropertyAccessor? If so, is it reasonable?

*I asked this within another question here but didn't get a response. I'm hoping to get one in a more concise question.

View 1 Replies

VS 2008 Controls Vs User Controls

Dec 2, 2009

How many controls can I have before I should start looking at user defind controls because of too many controls making my program go slow?

View 4 Replies

VS 2008 Missing Controls From Me.Controls()?

Nov 18, 2010

I am trying to cycle throught the lables on my form but it would appear that I am missing quite a few labels... I have a total of 69 lables on my form and I only get 5 hits on the msgbox.

Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then

[Code].....

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved