Creating A Class That Holds/draws Some Graphics?

Jan 13, 2011

Ok, I want to create a class that will handle a special rectangle graphic.In my form, I want to have two of these special rectangles.So, basically, I need two instances of that class in my form, right?I manage to initialize two, alright. But, how exactly am I supposed to manage drawing/graphics etc in a class, and the results to be displayed in my form?

View 2 Replies


ADVERTISEMENT

Interface And Graphics :: Creating A Class Holding Some Graphics?

Jan 12, 2011

Ok, I want to create a class that will handle a special rectangle graphic.In my form, I want to have two of these special rectangles. So, basically, I need two instances of that class in my form, right?I manage to initialize two, alright. But, how exactly am I supposed tomanage drawing/graphics etc in a class, and the results to be displayed in my form?

View 13 Replies

Check If Variable Holds An Instance Of Class?

Apr 10, 2011

Dim myObject As Something There I defined my variable myObject of type Something. But, as you can see, I am giving it no value yet. Sometime on runtime I want to check if myObject is holding a value or not. I tried this: If myObject <> Nothing Then But apparently I can't do such comparison.

View 3 Replies

VS 2008 Custom Class Called CustomItem That Holds Name And 'SomeProperty' Properties

Apr 22, 2009

Let's say I have a custom class called CustomItem that holds the Name and 'SomeProperty' properties:[code]Now, on the click of a Button, I want to select the CustomItem whose SomeProperty is equal to "Property 4". Of course, this is just "Item 4", but the names and properties are not that correlated in the real application than they are in this example.I have spent ages a long time ago figuring out how to do this. I could not directly set the SelectedItem, because I first need to get the CustomItem that actually matches my condition (SomeProperty = "Property 4"). My solution was to use a loop, looping through each item in the ListBox, and setting the SelectedItem when the right property has been found.[code]Now, is this the correct way to approach this problem? Is the LINQ query correct, or can it be done easier, without the casting? Also, is the LINQ query faster than the For loop, especially for a large amount of items? I expect it to be, but I don't know how to test this.

View 4 Replies

Written A Small Class Called 'Messages' That Holds The User Messages?

Sep 24, 2008

here I am again I have written a small class called 'Messages' that holds the user messages.The case is that I am not being able to import it. Here it is:

[Code]...

View 4 Replies

Interface And Graphics :: Making A Custom Class That Mocks The System.Drawing.Rectangle Class?

Jul 6, 2010

I'm making a custom class that mocks the System.Drawing.Rectangle class because the Rectangle class doesn't have a name property. I need a name property because I am adding all of my rectangles to a collection and I need a little more info stored than just their locale and size. So I changed the _onPaint event but nothing is working out when I run the program?

Public Class Rectanglar : Inherits UserControl
Public BackgroundColor As Color = Color.Blue
Public Sub New(ByVal name As String, ByVal XY As Point, ByVal Widthy As Integer, ByVal Heighty As Integer)

[code].....

View 5 Replies

Creating A 3d Gl Graphics Chat - & C# ?

Sep 19, 2011

I want to create a 3d graphics chat. (Think Imvu Not Single Life. I tried opensim, that's a virtual world, not what I'm looking for, plus would prefer to code my own, as I was needing to rewrite so much)This chat I would run between friends on my own server (no monies for server costs)

First I need to know if I am on the right track or not.

ie : need 3d graphics engine at base ? (Any opensource ones I could look at legally to learn from?) need instant group chat engine?(Any opensource ones I could look at legally to learn from?) need login forms, web browser/viewer to run graphical chat in? plus of course I would need a database of meshes and so on?

So first I need to know if I'm looking into the right areas, plus where to find up to date tutorials (ie links) the web is huge? (Oh and opinions from more experienced people.)

Furthermore can this all be coded in vb.net or do i need to code part in C# and add together, can that be done?

Plus I am using a trial version of ms visual studio 10, I am unable to purchase it when trial runs out and do not know what I can switch to then that is free an legal to use, to learn an create opensource projects.

View 7 Replies

Creating A Grid For 2d Graphics?

Sep 2, 2010

My Problem is when i click zoom the Retangles location get Thrown Off somtimes and messes with my Grid.

Draw Graphics To Screen
Public DRAW As BufferedGraphics
' Array Holds of Rectangles Used For tiles to hold Graphics
Public TileRtang(5 * 5) As Rectangle

[Code]...

View 2 Replies

C# - Graphics.CopyFromScreen Creating Blank Image

Sep 19, 2011

I am using VB.NET to try and capture a portion of the screen so I found this code in several places to capture the whole screen:

Dim screenSize = SystemInformation.PrimaryMonitorSize
Dim bitmap = New Bitmap(screenSize.Width, screenSize.Height)
Using g As Graphics = Graphics.FromImage(bitmap)
g.CopyFromScreen(New Point(0, 0), New Point(0, 0), screenSize)
End Using
bitmap.Save("c:scratchscreenshot.png", System.Drawing.Imaging.ImageFormat.Png)

This works with no error throw and the file is created successfully but the resulting image is completely transparent (it is the correct size) - This question relates to the same error but the solution is to use Win32 GDI which I want to avoid if possible

View 1 Replies

Creating Chess Graphics In Visual Basic?

Jun 16, 2012

I am creating a multiplayer chess game in Visual Basic.Net and I need to create tiles for the game. Earlier, I used buttons for the tiles, but then I realized that not only did they look ugly, but the coding part also became a problem. Also, the images of the chess pieces didn't properly fit on the buttons and they became distorted. Also, shifting the image to a different button every time a move was played also became very inefficient. So, in view of these difficulties, I want to build a proper board, but I have no idea where to start from or what controls to use for the design.

View 3 Replies

Interface And Graphics :: Creating A Graph From An Array?

Nov 29, 2008

I have the following array, (y axis) and wish display a curve. I am trying to find a way to code this so that can run it under Windows (PC) and under Windows mobile. The x axis increments 5 pixels with every point in my array.

Dim MyData() As Long = New Long(39) {10.0, 10.0, 10.0, 10.0, 11.0, 13.0, 16.0, 21.0, 30.0, 42.0, 54.0, 66.0, 78.0, 88.0, 92.0, 94.0, 95.0, 94.0, 93.0, 88.0, 82.0, 75.0, 66.0, 67.0, 72.0, 72.0, 67.0, 60.0, 55.0, 48.0, 41.0, 35.0, 29.0, 23.0, 18.0, 14.0, 12.0, 10.0

[code]......

View 13 Replies

Interface And Graphics :: Creating An Application With Mlutiple Forms

Mar 18, 2009

I am creating an application with mlutiple forms. When you click on a button in the main menu, the main menu will close and the new window will be diplayed. When you hit back on the new window, the main menu will be displayed.I know how to show new forms by using Form1.Show(). When I try to return to the main menu by hitting a back button I created, the main menu does not show up, but the program continues running. In the first form, I have the code: [code] Also, am I creating the new forms the right way for an application the will have maybe 15 forms?

View 2 Replies

Creating An Instance Of A Class From A Class Library?

May 18, 2010

I've createda vb.net class library where I've defined a number of small classes... nothing complicated, just working with strings, sending emails, etc.In another project, I reference the class library and I'm seemingly able to create an instance ofone of tclasses - intellisense shows me all of the plic properties, methods, etc... all looks perfect. No compile errors at all, nothing b gumdropsand lollipops.When I run the app I'm working on that references the class library, it fails at the point where I'm creating an instance of the class and gives me a vague exception, "System.TypeLoadException".

View 2 Replies

Interface And Graphics :: Creating Good Perlin Noise With .Net Code?

Mar 31, 2012

I've been trying to get some help for this in another thread,but it looks like it's a task that is going to need a wider audience to try and find someone who knows something about writing/creating procedural textures at the pixel level in VB.Net. The VB6 example I'm trying to convert to VB.Net is attached to this post.

[Code]...

View 6 Replies

Interface And Graphics :: Creating Outlook Style Navigation User Control?

Feb 3, 2010

I believe that this is in the correct forum due to it being about creating an interface item, but if I am wrong then let me know and I'll try and bring this thread to the attention of the mods to be moved to a more appropriate forum. I am currently trying to create a generic navigation control with a similar style to the outlook navigation bar. I have figured out how I would be able to dynamically create the bottom part where you select the menu option, but I'm struggling to figure out how I would be able to create the top part, which can contain any user control that the developer would want.

So basically what I'm trying to figure out is, is there a way to allow for a developer to add controls to a specific area of your user control?If there is a way of achieving that then if anyone knows how to do this;In ASP.Net you have the login controls and with one of them, you are able to have different views depending on whether the user who is viewing the web page is logged in or not. Is there a way of achieving this in VB.Net for a user control that could be set up so that I could have the developer able to switch the view in the designer to show them the view for when a specific navigation option has been selected.

The one thing that I have thought of that could possibly cause a problem is having the capability of knowing when one of the user controls has been clicked, while I haven't figured this out exactly, I believe I should be able to achieve this by having an event for the navigation user control that provides the developer a reference to the control.

While I would hope that I have explained what I'm thinking well, its before my first coffee of the morning so I might have missed out some detail which would help someone to help me if I have then please let me know and I'll provide any details required.Also if what I'm envisioning is Pie in the sky, then let me know and I'll just have to make a base which I would just have to make a more bespoke system.

View 1 Replies

See Different Colors (when Using Graphics Class) In A Palette Somewhere?

Sep 6, 2010

Is it possible to see the different colors (when using the graphics class) in a palette somewhere? It's hard to choose from the names only (DarkCyan, IndianRed ect, what is this!? )

View 7 Replies

Program That Draws An Average?

Jul 11, 2010

I am creating a project that can transform a value numbers to a graph and when I run it it doesn't draw anything.

[Code]...

View 5 Replies

Error Using Path Class To Create Graphics?

May 3, 2011

I get an error when I use the following code to create a path as described in the Mastering Visual Basic 2008 textbook. I am entering in in vb2010

Dim
MyPath As
New

[Code].....

View 4 Replies

When App Loads It Draws A Grid On PicCanvas

May 23, 2010

I am building a VB application (Visual Studio 2008). I have a drawing app where a user can draw out a 2d house-floorplan.When the app loads, it draws a grid on a picCanvas. Everything works the way that i want it to except that the lines don't "snap-to-grid" as they are being drawn.I suspect that the problem is in the picCanvas paint sub. [code]

View 1 Replies

Interface And Graphics :: Make A Class For A Custom Button?

Jan 2, 2012

i want to make a class for a custom button for which the user of the class can choose his own images for Normal, mouse over and mouse down state.

View 5 Replies

VS 2008 Displays A List Of Previous Draws

Apr 7, 2010

In my application for checking Irish Lottery numbers I have a form which displays a list of previous draws. The form contains a listview which is populated from a setting in my.settings as follows: [code] I would like to replace "Wednesday" with "Wed" before adding the item to the listview. I have tried using strings.replace to acheive this in various parts of the above code but each time the code runs the listview still displays the full day.

View 2 Replies

Making An Application Where User Draws A Shape On A Picture Box?

Dec 25, 2010

I'm making an application where a user draws a shape on a picture box( this will be saved on a bitmap image), then another user has to draw on that shape (=follow it ) . if the 2nd user goes too far from the line then an error message will appear.

for example( in case i couldn't clarify this well!)the 1st user draws a a vertical line, the 2nd user has to follow it, if-while drawing on it- he gets too far horizontally, there would be the error.

I'm currently thinking of comparing every point by the 2nd user to its equivalent in an array containing the points by the first user.

View 5 Replies

Restoring A Window's Previous Location / State, It Draws Twice?

Jul 7, 2009

recommend the cleanest way to save / restore a winform's location and state? For some time now I've been using a method similiar to what I posted below (based on the CodeProject: [URL]..The problem with this method is that when the form loads, it is drawn in an initial location, then moved / maximized afterwards. The effect creates somewhat of an eye sore watching the window draw, then quickly update... but in Vista it is a lot more obvious.

What I would like to do is restore a form to it's previously saved location / state invisible to the user, then show it once it's where it needs to be. Or, just know of the ideal way this is supposed to be done - specifically in Vista.

[Code]...

View 4 Replies

Draws Text On A PictureBox Using A Font That Is Already Installed (registered) In System Fonts?

Nov 23, 2009

I'm working on a program (Under Visual Basic .NET 2008) that draws text on a PictureBox using a font that is already installed (registered) in system fonts. I'm wondering how can I perform the same but with a font that is not already installed on system, by adding this font file (*.ttf usually) to my solution explorer and use it in my program, given that this font file must be included in exe file.

View 5 Replies

Make A User Control That Draws A Line And Adds Transparency Over A Form

Nov 12, 2010

I am an intern at a company doing Drawing Tools for their program. My supervisor is currently having me just make a user control that draws a line and adds transparency over a form. (I started this internship very early, so my knowledge is very limited compared to what it should be for a standard intern)

This is what I have so far:

Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
If MyBG Is Nothing Then
MyBG = New Bitmap(Me.Width, Me.Height)

[CODE]...

View 5 Replies

Setup A Login Form Which Draws The Username/password From An Online Database?

Jun 15, 2011

I'm trying to set up a login form which draws the username/password from an online database but keep getting the same error(shown in attachment).

Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient
Public Class LoginForm1

[code]....

View 6 Replies

How To Make A Program That Holds A Dll

Jan 24, 2011

How can I make a program that holds a dll(Ex: when i press the extract button it extracts it to the specified path)?Well, If it is not worth it, it is not fun - you say programmers are boring but i say they are worth it.

View 5 Replies

Way To Have An Array That Holds Other Arrays

Dec 8, 2011

Is there any way to have an array that holds other arrays in VB? So you could call it like Array1(Array2(0))

View 2 Replies

Creating An Exe And Best Use Of A Class?

Aug 2, 2010

I have a project where I need to create an exe that will execute through a scheduler every five minutes The visual basic file will call a SQL Stored procedure, get values and then write these values to a separate database system (that is NOT SQL).

View 4 Replies

Refresh - Program, Draws A Rectangle, Marks The X & Y Axis, & Plots A Dashed Line Grid

Dec 16, 2009

This is simple program, draws a rectangle, marks the x & y axis, & plots a dashed line grid. However, the grid sub has to be called twice - only then will the grid line be visible. Why does this happen?

CODE:

View 1 Replies







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