VS 2010 Preventing Redraw Of Control?
May 12, 2012
I have a RectangleShape on a form and certain events that invoke the Paint event for the Shape.But it redraws unwantedly when I drag the form to the taskbar or minimize and then maximize it or press the alt or tab key while the form has focus.I do not want this to happen. I have made sure that no other event fires the RectangleShape's Paint() event.
View 5 Replies
ADVERTISEMENT
May 26, 2010
I have a semi-transparent custom control in vb2005 - works fine, except I can't get it to update/refresh correctly. If I update the custom parameter _backgroundColor, the control appears to be overpainted - e.g. each attempt to update the colour of the control overpaints the existing colour - until it becomes a solid block of colour. However, forcing a refresh of the form makes the control display the correct colour. Any ideas? I don't want to have to repaint the form just to get this control to render correctly. Code for the custom control is below.
[Code]...
View 1 Replies
Oct 21, 2010
I am working on developing a simple console game in Visual Basic in which the "level" is drawn out after being read from a file.
[Code]...
View 1 Replies
Apr 1, 2011
I am writing a VB program that measures the voltage on a circuit and then graphs the voltage value. I read what the voltage is at ever milisecond and load that value into an array and shift all the data one to the right. On each timer tick i regraph the data.
The problem i am having is on each tick i erase the picturebox then i redraw the graph using the new array. Because of this the further out the line is from the start of the drawing processes the less it shows the line. You get a flicker effect. I have been seeing if there are ways to remove the flicker but the few things i have found have to deal with doublebuffered but i do not think that is the issue here. I think i need to find some other way to clear the picturebox.[code]...
View 9 Replies
May 30, 2011
I'm trying to do a little remake of the old game Achtung! Die Kurve, which is a snake-like game, but with multiple players trying to corner eachother until one remains. Don't play it, it's way to addictive, thats why I'm doing the remake now, I want to play it with up to 8 players instead of 6.
Now here's the problem: to draw the snake, I just use the GDI+ and make it draw a 3x3 rectangle on the form background. It works fine, until you resize or minimize/maximize or something like that, which causes a complete repaint of the form. This is not a problem... but when I press ALT or TAB, the form repaints.
And even stranger: it only happens the first time I hit each button. I can make it happen twice by hitting ALT and then TAB or vice versa, after that, nothing. I really don't get it, and its driving me crazy. I dont want a game with a splash screen saying 'First hit alt, then tab to start the game. Not at the same time that makes you leave the game.'
View 1 Replies
May 2, 2009
I'm working on an application with multiple forms. On the first form, the user clicks a button and a simple shape is drawn in a picturebox.Depending on which shape is drawn, a value is assigned to a global variable called baseShape. I want that shape to be drawn automatically on the next form when that form is shown. I haven't been able to find any discussion on "passing graphics" from one form to another.[code]...
View 3 Replies
Jan 20, 2009
We are using a ribbon control from a 3rd party that has a bug. When you click on another app, fragments of our software still shows on the screen. The company that makes the ribbon is working on a patch, but I would like to get the app working while we are waiting. how to force windows to repaint the client area behind the form when the form is deactivated?
I've searched and been reading through posts, but most everyone wants to repaint portions of their app. I want windows to redraw what should be there when my app isn't in front anymore.
View 1 Replies
Feb 17, 2012
I have the interesting task of doing some graphs using VB.NET. So far, everything that I´ve been reading about GDI+ and e.graphics whatever is really weird. All I want to do is1) Calculate some coordinates clicking button 12) Click button 2 to draw a line with the numbers from button 13) Click button 1 to get new coordinates5) click button 3 to clear the graph. So I decided to draw everthing on top of a Panel, called panel1. I have a routine that draws on screen called drawlines,
Private Sub drawlines(ByVal g As Graphics, ByVal c As Color)
Dim p As New Pen(c, 1)
g.DrawLine(p, xStart, yStart, xEnd, yEnd)
[code].....
View 1 Replies
Feb 7, 2008
Here' s my code to draw a single line on a windows form.
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawLine(myPen, 0, 0, 200, 200)
myPen.Dispose()
formGraphics.Dispose()
I would simply like to erase it now. I've read that the best way to do this is to re-draw the whole form, or to delete the line object..etc..
View 4 Replies
Jun 20, 2012
I am having and issue with a VB.NET App that displays data derived from a database in a DataGridView Control. I am retrieving the data into a dataview and then setting the Grid.Datasource = oDView. On most machines it refreshes the data cleanly and quickly as you would expect.
[Code]...
View 2 Replies
Jul 22, 2010
I am using a DrawItem and MeasureItem events to paint a combobox with a DrawMode of OwnerDrawVariable.Basically, I'm trying to have the user highlight a selection with the mouse, and then press the space bar to toggle the Save status of a song list. Then I call the Me.Refresh() event for the form in an attempt to redraw the form and the ComboBox.The problem that I am running into is that only the Combobox itself (not the drop-down area) that is a control on the main form is redrawing, and the text that is behind the mouse-highlighted selection of the drop-down list is not changing from Red to Black as I believe it should. If I move the mouse to another selection, then the color does in fact update.[code]
View 1 Replies
Feb 12, 2011
I have developed an application where i am drawing line using the mouse like a pen (it can be of any shape) i want to save the location of the object and redraw it later using the drawn location saved on any xml or text file. Instead of saving the edited image i want to save the location only to save the space in the sql server.
View 2 Replies
Jul 8, 2009
The VB2K8 Express IDE is hanging intermittantly when I click on the form's Design tab. The tab's work area goes blank and a wait cursor appears. I can't switch tabs or do anything else within the IDE at this point. I have to go to the Task Manager, end the VB taskk, and restart the IDE. VB is at SP 1 with .NET 3.5. I have no third party add-ins or controls except for the Visual Basic Power Packs which aren't being used. At this point it is annoying and I haven't lost anything yet but it is happening more frequently over time.
View 4 Replies
Mar 17, 2012
I am using a button on a form which creates a chart at runtime when the user clicks the button. it works ok for the first time but when I select the button the second time I get a square diagonal box or indexoutofrange Exception.Note: I have another button that clears the series from the chart before reselecting the button that creates the chart.
Below is the code segment
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Static Dim counter As Integer = 0
[Code].....
View 1 Replies
Aug 26, 2009
I've got a basic idea of what i'm wanting to do, just been out of it too long to remember how to do it. I'm wanting to load an image, not display it. Get all the pixel data, then redraw the image pixel for pixel in mspaint.
View 16 Replies
Jun 19, 2012
I uses datagridview for show query results from database which may have 0 to x number of rows. So I made calculation to calculate size of underlaying form and my datagridview dependable on number of matched rows. Underlying form is transparent and all of that looks like user control what appears and works just fine. But here is one issue: Every time datagrid have to grow, black square in that area is showed before datagrid is filled, what is not nice and surely unwanted. Did datagridview have some mechanism to freeze it and show data when populating is finished?
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim tw As Integer = 0
Dim n As Integer = 0
Dim sqlText As String
Dim reader As OdbcDataReader = Nothing
[Code] .....
View 1 Replies
Feb 9, 2012
I have a DataGridView with a single column that currently displays a short list of items. When the user clicks a button to run an update, each row/cell is read and processing begins. I would like to have the selection idicator move down the rows in the DataGridView as it completes processing of each record. How can I display the iteration of the DataGridView rows while the processing is underway? A redraw of the DataGridView or something.This is a VB.net windows form, I know how to do this with AJAX I think, but how can I in a Windows form?
View 1 Replies
Jun 22, 2010
I have a component which hooks up with the paint event of assigned control and draws on its surface, Whenever i make any changes to the component i need to resize the form or control at design time in order to see the changes.
I want to ask if there is any other way to refresh the contents of a control at design time which forces it to redraw.
View 6 Replies
Oct 25, 2010
I have this code
UPDATE OPENQUERY (db,'SELECT * FROM table WHERE ref = ''"+ Ref +"'' AND bookno = ''"+ Session("number") +"'' ')
How would I prevent SQL Injections on this?
[code].....
View 8 Replies
Dec 29, 2009
Is there a way to prevent the VB .NET editor from saving the project whenever IT LIKES TO ? It very annoying ; it so stupid that it saves things that I don't want to and that I didn't ask it to do .If I add a form and then close the editor , when I open the project again , that form is still there though I DIDN'T save it !If I change a declaration from Friend to Public and close the editor without saving , then when I open again the project , my modified code remains modified , though I DID NOT save it !Today I realized that if I delete some controls of a form and then close the Editor , then when I reopen it , the controls are missing for good ! It saved that modification by itself !
View 3 Replies
Feb 26, 2012
I've completed an assignment that requires me to search through two listboxes for a particular number.If the number is found, the text on a label changes to a dollar amount, otherwise a message box is displayed letting the user know that the requested number cannot be found.It works well enough, searches through the listboxes, finds the number, and displays the message box when it can't be found.However, the message box shows repeatedly up to five times.After the user clicks "OK" on the fifth appearance, the program crashed and displays the follow message."Invalid Argument = Value of '5' is not valid for 'index'.Parameter name: index."I don't know what's causing this, or how to fix it.I do use the index as a counter at a portion of the program...but I'm not sure where I went wrong with it.[code]Also there are five items in the second listbox...probably has something to do with it.
View 2 Replies
Sep 20, 2010
I designed an application in vb.net 2005 while using Administrator account on vista.After compiling the application it start requesting for elevation during startup.I will like to prevent this, because the customer is complaning
View 2 Replies
Sep 27, 2011
i have develop small project in vb.net and also created setup for it with license key but when i install the project in C drive it can run on another machine with simply copy it how to prevent this piracy
View 5 Replies
Sep 24, 2009
I have two froms when one from is opend it should not be minimized when mouse clicked outside the from like the message box in vb.net
View 1 Replies
Jun 28, 2010
I have 2 forms. Form1 and Form2 When the user calls for a new record to be created, Form2 shows modally centered in form1. I have disabled the control box and need to stop the form from being moved by the mouse. I do not see (Movable) in the properties list.
View 3 Replies
Nov 15, 2011
I have a program, I have published it, and I have been actually using it in my PC. Whenever it encounters an error, the JIT debugger comes out. How do I prevent it from popping up using try...catch blocks, or is there any other ways or code on how to do this?
View 3 Replies
Dec 9, 2009
<VB.NET 2008>I created a MDI frame and I try to open a Winform by clicking menu.I do not want to allow opening same winform which is already opened by user.How do I check whether the winform is already opened or not?
View 5 Replies
Dec 12, 2010
I am trying to prevent the user from activating a Print command for the content displayed in a WebBrowser. If the user hits Ctr P, the print dialog appears. I would think I have to trap this, but am not sure how to do this. There is no KeyPress event in the browser, and using the keypress event on the Form does not appear to trigger when text is typed into browser.
View 3 Replies
May 3, 2012
The original post provoked more responses than I anticipated. Therefore I have tried to draw them together with this post.There appear to be several schools of thought on this issue.One holds that I should not release time-bombed software because it is illegal.
Suppose I include code that often randomly checks if the user is registered and then puts up a message and shuts down the program if a check fails - rather like an improved nag screen. Would this be regarded as illegal?One holds that I should not worry about it because the pirates wouldn't buy my software anyway.
Maybe, but there's no fun in that.One holds that it is a waste of time because it is impossible to protect 100%.Maybe, but once again no fun.My view was that an honest user buying from my site would get a genuine copy. If a dishonest user got a harmful copy and lost the lot then I couldn't care less.Reed Kimble pointed out the existence of "fake sellers" who could cause harm by selling honest users a dishonest copy.This is a problem that I had not thought of and it poses a dilemma.
If I do include protection, then how do I distinguish between and honest user and a dishonest one? They will both be caught by the protection.should I not include any protection at all so that the honest user doesn't lose out, and just accept that the dishonest one gets away with it?Or nail the pirate and accept the honest loser as collateral damage?
[code]....
View 8 Replies
Mar 16, 2009
What's the best way to prevent javascript injections in a VB.NET Web Application? Is there some way of disabling javascript on the pageload event?Recently, part of the security plan for our vb.net product was to simply disable buttons on the page that weren't available to the specific user. However, I informed the guy who thought of the idea that typing
javascript:alert(document.getElementById("Button1").disabled="")
in the address bar would re-enable the button.
Update:Aside from validating user input, how can I protect the website from being toyed with from the address bar?
View 5 Replies