How To Properly Change SetLocaltime

Sep 13, 2009

this is vb.net 2005, I have some issues I believe with time format.everytime when I try to change datetime on my local PC, I got 9/11/2009 8:00PM Here is my

Private Declare Function SetLocalTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME) As UInt32
Structure SYSTEMTIME
Public wYear As UInt16
Public wMonth As UInt16
Public wDayOfWeek As UInt16

[code].....

is it any trouble if I try to apply that date on some other machine, like any built in additional timer within Windows XP?

View 4 Replies


ADVERTISEMENT

UICulture Change Functionality - Form Control Names Not Returning Properly

Jun 12, 2011

I am trying some Uiculture change functionality. In that I need the name and text of controls in a form to change the culture. I got some Demo project and it is in C#. I tried to make the same functionality with the C#.net and Also using VB.net. But the below mentioned code returns control name with an underscore as prefix. But I don't want underscore. Code is actually written in Class library. It works perfectly in C#.

Code is written below
Dim fields As FieldInfo() = form.[GetType]().GetFields(BindingFlags.Instance Or BindingFlags.DeclaredOnly Or BindingFlags.NonPublic)

View 1 Replies

How To Properly Open A Image Using Bitmap Class And Dispose It Properly

Jun 22, 2010

I am looking for a code snippet which opens a image, creates a clone of this bitmap in memory disposes this opened image so that all handles are closed.

Usually we can open a bitmap using this[code...]

the following code however keeps the Image File locked until the application is running, any suggestions how to dispose it properly. (So that no handle is left open )

Things i already tried: use dispose method of bitmap <= doesnt work (need to write implementation)
Using Block also doesnt work.

View 2 Replies

Change A Drop-down Menu In VB From Click-to-change To Just Change When Selected?

Feb 4, 2012

I'm using Visual Studio 2010 / VB / dot net 4.0, and I have a drop-down menu in my left column that switches resource languages for the end user. It reads like this:

--------English ------- <<- Engish is always the default top language option
French |
Spanish |

[code].....

View 2 Replies

.net - How To Use Bitvector32 Properly

Dec 23, 2010

I have

Dim bv As New Specialized.BitVector32(25)
Dim sb As String = "0b" 'I resisted the urge to use a stringbuilder
For i As Integer = 31 To 0 Step -1

[Code]....

I only wanted to use BitVector32 for bit flags and I wanted the output to be

0b00000000000000000000000000011001

How do I set this up properly?

View 2 Replies

Using The 'And' Operator Properly?

Apr 8, 2010

In the project�s btnReadNumber click event handler, replace the code in the try section of the try/catch block � the two if statements and the unconditionally executed code � with one if-else statement that performs the same tasks. Use the And operator to write the if-statement�s condition.What I don't understand is how am I supposed to use the 'And' operator so that when I insert a number between 32-16384 in the text box it'll allow it to go through and at the same time not allow any numbers lower than 32(lower_bound) and higher than 16384(upper_bound) to go through.I've use the 'Or' operator and that was simple, but with 'And' I'm not understanding it.Remember it has to be with the 'AND' operator. I bold the area where my problem is at. It's obviously not the right answer, but that's where I was stumped.

Dim sum As Integer = 0
Const upper_bound As Integer = 16384
Const lower_bound As Integer = 32

[code]....

View 4 Replies

Value Not Saving Properly

Feb 15, 2012

Value not saving properly [code]...

View 4 Replies

*.txt Filter Not Working Properly?

Mar 14, 2011

In my word processor I have an 'Open' option on a menu strip. Here is the code for it:

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
With ofdFile
.Title = "Select a file to open"[code]....

For some reason when I press the 'Open' item and open the ofdFile dialog box .txt files do not appear even when I have the 'Text Files' filter selected However, when I use the 'All Files' filter they appear. And the 'HTML Files filter is also working properly.Why are the .txt files not appearing when I use the Text Files filter?

View 4 Replies

.NET 2.0 .settings Not Working Properly?

Oct 18, 2011

I don't even know where to begin describing this. I have a project, that uses settings, for some paths, settings that I retrieve with the My.Settings. function.In my laptop, when I change the .exe.config file, the settings are updated accordingly, but when I try that on the production server, it just shows the default value used while compiling.

I tried changing the solution configurations to debug and other custom configs with no effect.Tried to use the same folder copied and pasted without version control, still the same result.Tried a co-workers laptop, by using the last svn revision, it works there too. But on neither of the servers works.

View 1 Replies

ArrayList Indexes Not Set Properly?

Aug 25, 2010

I have some basic code to fill items in an ArrayList as follows:

Dim intSteps As ArrayList = New ArrayList()
elect Case Session("type")
Case 1

[code]....

View 2 Replies

Asp.net - Boolean Not Setting Properly?

Mar 3, 2011

I have the following code in an Asp.Net user control:

Me.pnlAddComment.Visible = MyBase.Associate.IsAgent()
Me.lblRating.Visible = Me.pnlAddComment.Visible
Me.Rating1.Visible = Me.pnlAddComment.Visible

Now when I run this code, the value of MyBase.Associate.IsAgent() is true. Yet at no point is Me.pnlAddComment.Visible evaluating to true. When I output the results as Response.Write statements, it shows IsAgent = True, pnlAddComment.Visible = False. When I run it in debug mode, placing the line break on the second line above to allow the set to occur: I put the mouse over IsAgent and it displays "True"; I put the mouse over pnlAddComment.Visible and it displays "False".

A Co-worker suggested that it's possible that it's Panel.Visible black box code in the getter that allows the assignment to occur but returns false because some parent object is set (at that point in the code execution) to False. I've reviewed the parent objects and at no time do any of them appear to be set to not visible.

If this were a reference type I might be convinced that some other process is modifying the reference between this assignment and when it is actually used (at Render), but this is happening right at this line of code.What would cause this boolean assignment to behave this way without throwing an exception?

Solution:The answer turned out to be a parent object in the control hierarchy located outside of the user control itself. Since nothing was explicitly set to false, and I agreed with @Shadow Wizard, @Damien_The_Unbeliever and @CodeMonkey1 that it had to be some outside control influencing the panel at that point, I decided to put a recursive while loop to test the parent of each user control in the hierarchy at that point:

Dim o as Object = Me.pnlAddComment.Parent
While o IsNot Nothing
Me.lblMessage.Text &= "<br />" & o.ID & ": " & o.Visible.ToString()
o = o.Parent
End While

Then I just ran this on the server and the output came back with the full visibility of each control in the chain. What ended up occurring is that this control was contained within a view control within a MultiView. This view control is expected to be visible as it is supposed to be the ActiveView for this particular call, but at the point in the life cycle when my code is run, the view has not been identified as the active view. Since it's not officially active, the view is implicitly false, and all child controls return a value of false when Visible is queried.

The rest of the assignments behave as expected from that point. The lblRating control is set to false (permanently) because at that moment the proper visibility setting for pnlAddComment is false. The lesson I've learned here is not to make control visibilities dependent on each other in this fashion when there is an alternative (and just as simple) method.

View 3 Replies

Assemblies Not Being Loaded Properly?

Sep 19, 2009

I have a windows forms Application using DCOM to connect to another server in order to retrieve data from a database. The program works perfectly fine on my develeopment box both inside of and outside of the idea.However it throws an exception on my test box: System.Exception.... TYPE_E_CANTLOADLIBRARY. The error happens when accessing a property of on the the public DCOM classes. The property holds an instance of one of the private classes for the DCOM. I've compared the registries and all the relevant entries seem to be the same. When I compared the dumps I noticed that System.Config and System.XML werent loaded on the test machine, even though they are installed and appear to be in the GAC.

[Code]...

View 6 Replies

Calculations Not Working Properly?

Apr 17, 2012

I cannot figure out why my calculation is not working. I am doing for 1 to 12 and it gives me 12 inputs but counts my entries as 13? What am I missing. If I change it to 0 to 11 same thing. I am not sure what the issue is, but I cannot see it, and am not sure where to look.I need to end up with 12 cycles through and intEntries to be 12.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'initialize accumulator
Dim decEntries As Decimal[code].......

View 1 Replies

Can't Order The Data Properly

Sep 15, 2010

I have a VB.Net 2008/Access 2007 app that I can�t get to display data in an organized way on a listview. The listview displays the data in the order that the data was entered in the products table. In the SQL statement that loads the listview I put ORDER BY SupplierTbl.CompanyName but it doesn't do it. The listview shows the data in the order that the records were entered in the database. So then I was going to settle for if I can get the listview sorted by clicking on the column header.If I can get that to work then that would be acceptable. So I then implemented the sort routine. The sort works and it doesn't.If you click on a column header then all the rows show the information nicely. The database has an OLE object column for storing images. Customer wants images stored in the database not file paths. When you click the listview the image displays in a picturebox.

The proper images display when the listview is clicked when I use the SQL statement below without the ORDER BY. But when I click on a column header and reorder the display it's no good. If you click on a row in the listview the wrong image is being displayed. It displays them in the order as they were in before the sort. All the other columns look good and are behaving except for the Image column. So that then makes me wonder if my original problem with the ORDER BY is directly related with the OLE object column. Is there something about this data type that I need to know to manipulate it in SQL? My reaction is that maybe since this column is resource heavy it goes by different rules. Can someone please tell me what I need to do to make the end result have some order? This is the SQL statement without the ORDER BY:

command.CommandText = "SELECT ProductTbl.ProductID, ProductTbl.PartNumber, " & _
" ProductTbl.AltPartNumber, ProductTbl.Description, ProductTbl.SupplierID, " & _
" SupplierTbl.SupplierID, SupplierTbl.CompanyName, ProductTbl.Category, " & _

[code]....

View 2 Replies

Can't Resize Font Properly

May 29, 2010

I have a timer program. Initially, the font for the time is the correct size, and when I click "start", the time is the right size too(I had set the initial size to 26 in the properties menu). When I click "break", once the time is up, it displays "Break Over!!" to fit the label(because I changed the font size). Then when I click "start" again, the font has shrunken, even though I set it back to the original size of 26. Why is the font size for the timer not back to it's original size when I click "start" after I have clicked "break"?[code]...

View 2 Replies

Cannot Decrypt PDF Files Properly

Dec 26, 2011

I'm joining several files and would like to encrypt them with AES. As a test I'm joining the exact same file twice, but I'm never able to properly decrypt the second file.

Steps to reproduce:
Make sure you have a file "C:Original.pdf" or change the filepath.

1) Click Button1 to encrypt the file. This will create an encrypted file named "Encrypted.bin"

2) Click Button2 to decrypt the file. This will create a decrypted file named "Decrypted.pdf"
Both "Original.pdf" and "Decrypted.pdf" are 100% the same.

3) Uncomment the code between the hash character lines.

4) Repeat the first two steps.
"Original.pdf" and "Decrypted.pdf" are now not the same.

vb.net
Private enc As New Encrypt
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Encrypt
enc.EncryptDecrypt("C:Original.pdf", "C:Encrypted.bin", True)
[Code] .....

View 1 Replies

Cannot Read A File Properly?

Feb 22, 2009

I'm in need of a simple Regular Expression that will match all strings that start with the string "textures/". The problem probably is when to end the match.

Here is an example of the type of file I need to parse:

[Code]...

I have attached an example file (it's from a game, and it's a free game, so I don't think this is not allowed?). When opening that with Notepad I see loads of spaces and a few strange characters. When opening it with Wordpad, I see mostly strange characters (but the "textures/..." strings I need are still there). When reading it with VB (IO.File.ReadAllText or using a StreamReader) I cannot get it to show more than a few random characters, and the "textures/..." strings are no longer there...

View 12 Replies

Cannot Set Primary Key Properly For Table

May 8, 2012

After days of labouring, debugging and researching, im on the 3rd to last line and im stuck. This isnt the full code, but the relevant parts.

Dim dbProvider As String
Dim dbSource As String
Dim con As New OleDb.OleDbConnection

[Code].....

I understand this means my table doesnt have a primary key, but i have set one.

View 1 Replies

Ctype Not Working Properly?

Nov 1, 2009

dim testpanel as new panel
dim test as CType(testpanel, Control))
msgbox(typename(test)) ' it gives me "panel"

'i dun get it, how can typename of test give me Panel when i explicitly call it to be converted to a Control type?

View 9 Replies

E.KeyCode Not Working Properly?

Jul 4, 2011

So I opened 2 forms, Form2.vb and Form3.vbNow I put this:

Private Sub Form1_PreviewKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles Me.PreviewKeyDown
If e.KeyCode = Keys.F8 Then

[code].....

View 8 Replies

Exit An Application Properly?

Nov 25, 2010

i will just use Environment.Exit(code) to exit an application. (usually through a button click) , but i would like to know is it the proper way to exit , ie, releasing memory etc etc...

View 3 Replies

Form Is Not Showing Properly

Oct 8, 2011

Using VB.Net[code]...

When textbox1.focus() at that time i clicked Control + Enter key, the formid=55 is showing instead of formid=54.

View 1 Replies

Form Not Displaying Properly?

Mar 30, 2010

I have a windows form with listboxes, buttons and a checkbox. It works fine at home but when I take it to school it doesn't display properly. I have been given full privileges and the .NET framework V3.5 is installed. I have all my buttons/checkboxes on the right hand side but they don't display like they aren't even there (there is no extra blank form space either). The form sized wasn't locked

View 3 Replies

Get Passedtext Properly Working?

Mar 25, 2012

i am making a simultaneous equations program and cant figure how to get passedtext properly working, as i declare the amount questions the user wants to answer in the settings form, it then passes this over to the simultaneous equations form and i cant get it to keep spawning questions until the number is reached.

Public Class simultaneousequations
Dim Random As New Random
Dim typeofquestion As String = Random.Next(1, 3)

[code].....

View 5 Replies

How To Close Forms Properly

Aug 23, 2010

I have couple of forms can be opened on the screen but how can close all forms properly when i click the "x" button from the main form?

View 1 Replies

How To Declare Variables Properly

Jun 8, 2011

I am needing help in understanding how to declare variables properly. I am needing to write as program that calculates the commission for a sales person. I keep getting a error listed below. I thought I declared the salestextbox, costtextbox as integers correctly to use them in the calculation. I Copied my code below also. I have reread the chapter again and I am still lose.[code]

View 3 Replies

How To Properly Increment Progressbar

Mar 31, 2009

As the above subject suggests, I need some ideas on how to properly increment a progress bar while iterating through records with the backgroundworker component. This is what I've done so far...

Code: Private Sub tsmnuitmRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsmnuitmRefresh.Click
tvwFolders.Nodes.Clear()
bgwNodes.RunWorkerAsync()
End Sub

[Code]...

View 2 Replies

How To Properly Read A Log From Fiddler

Apr 2, 2012

I'm new to WebRequest authentication and have been researching how to authenticate w/ a couple websites to pull some excel data from them. Couple things I'm confused about is

a.) how to properly read a log from Fiddler (using this to pick up get/post data from the website authentication)

b.) how do use the data from Fiddler to program the VB.NET WebRequest properly.

I've been able to authenticate w/ websites that use simple authentication HTTPS, but any site that does any redirects/REST/cookie auth I'm lost.

View 1 Replies

How To Structure Code Properly

Jan 28, 2011

5 records to add

Try
Do While
Insert Statement

[code]....

When i get an error concerning duplicated values found, it just catch the sqlexception, display a message and exit try. But i want it to continue adding the remaining record even when a record of duplicated values is found.

View 10 Replies

How To Use Mod Properly To Find Even Integers And Add To Get Tot

Mar 7, 2011

Sub Main()
Dim sum, counter As Double
Dim beginnum, endnum, btwnnum As Integer

[code].....

View 2 Replies







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