What appears to be a simple logic implementation is embarassing me each time I try to get it done. I have a very simple task: loop over rows in a DataTable and each time the next row is reached, set a variable alternating between 0 and 1.
Dim the alternatingValue as Integer
For Each dr As Data.DataRow In DT
alternatingValue = 0
Next
...so, when this loop finishes with this row, I need to set the alternatingValue = 1 Then when the next loop finishes, I need to set the alternatingValue = 0?
one of my forms wont load! it is not underlined in blue or whatever but it keeps giving me a runtime error and i dont know why bc it was working before
Code: Private Sub AddEmployeeToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddEmployeeToolStripMenuItem.Click NewEmployee.Visible = True 'throwing the error Me.Enabled = False End Sub
thats how i have been opening my other forms too but just this one gives me this error "An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object."
we develop a dll in vb.net and we call that dll in our application .eacgh and every time we register the dll using regasm method.is there is any code for register the dll
Basically,I would like to bind the data into datagridview which called PODetailsGrid during page_load. After the data had been bind into the gridview,I would like to make alternate color in each row. For example, the font color for row1 is Black,then second row should be Red,then third row will be Black again..
Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GeneratePODetailsView(GenerateDataSource()) End Sub
I know how to have alternate row colors with ListView. But how about with ListBox? I've run a search. I read in some web sites where they say you can't. Is that true? Meanwhile, I've done something like: For i As Integer = 0 To ListBox1.Items.Count - 1 Step 1 If i Mod 2 = 0 Then ListBox1. BackColor = Color.FromArgb(150, 250, 255) Else ListBox1. BackColor = Color.White End If Next i with ListBox's DrawItem event. And it doesn't work.
In the program I'm writing I need to have a form load a web page and insert a username and password, then if the resulting site of the login is the error page, it will show the original login form and if it succeeds in the login, it will show another form.[code]...
I'm trying to update the UI from a background thread, but the method I'm using at the moment isn't working. From what I've been reading, the method I'm using should work, but it isn't.[code]...
I would like to get a 'due' or predicted inspection date based on alternating with another date? How would I go about this? [Code] The due inspection either can be 24 months (second yearly) but it has to alternate with the last safety inspection.
I'm fairly new to VB.net and this is my first post on this forum.I'm creating a website in Visual Web Developer 2010 Express in ASP.NET/VB and I'm trying to find out how to alternate a Reponse.Redirect, basically I'm looking to redirect every other visitor to go to a different site.
For example:
Visitor 1 gets: Response.Redirect("http://site-a.com") Visitor 2 gets: Response.Redirect("http://site-b.com") Visitor 3 gets: Response.Redirect("http://site-a.com") Visitor 4 gets: Response.Redirect("http://site-b.com") and so on
Also, if there is a way to set a cookie for that visitor, so if they visited within let's say the last 90 days, they will go to the same site they visited before, and not be redirected by the Response.Redirect.
Currently I'm working on a program that will run out of my startup folder when I logon to windows so instead of typing in a password my program will run fullscreen blocking any access to Windows until the user presses the buttons on the form in the correct order. In order for this program to actually be purposeful i need to block keystrokes such as "Alt-F4" and "Cntrl-Alt-Delete". I've looked around on google searches and I usually find a similar solution but when
Imports System.Diagnostics Imports System.Runtime.InteropServices Public Class Form1
I want a supervisor override capability for my application.I want to provide a username login prompt (including domain). If the user is in the approved list and the password correct, show advanced controls.What .NET code / functions allow this?
NOTE: VB.net answers preferred. C# also accepted.
EDIT: the logged in user is not the user authorizing the override.
Basically,I would like to bind the data into datagridview which called PODetailsGrid during page_load. After the data had been bind into the gridview,I would like to make alternate color in each row. For example, the font color for row1 is Black,then second row should be Red,then third row will be Black again and so on..
Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GeneratePODetailsView(GenerateDataSource()) End Sub
I am writing a program that stores filenames, along with a lot of information about the files in a database. I need to be able to open these files in three different programs from my application. One of these programs, AutoCAD is the default program for the files, but the other two are more difficult. These two need to open the file in a program that is not the default for the file type. Eventually, I'd also like to allow users to point the application to the instance of AutoCAD, MasterWorks, or FeatureCAM that they want to open. I have found articles that explain how to open a file in a default application and articles that tell me how to open any application with a file name, but only 1 suggestion of how to control the program used to open the file. For some reason I cannot get AutoCAD to recognize the file I feed in if I use this method though, so I think it's wrong. This is the method I found that doesn't work:
Start("D:Program Files (x86)AutoCAD 2007acad.exe", file)file is a variable that contains my file name. Since this works fine when I take the program path out, I know the filename is correct, but AutoCAD says it is not.
I created a VB.NET Winforms app a while ago that printed drawings. The way it did this was to copy files from a network share to the folder for a plotter's que. This plotter would automatically just print anything that was dropped into this folder, which was specified with a path like \Btltmkeng_plt_q. I would do this by using the System.IO.File.Copy method. This worked well, until the company switched to a new printer. When my app copies the file, the printer only prints blank pages.
However, if I open two Windows Explorer apps, and manually drag the file from the network folder to the printer que folder, it works! This proves that the printer can handle these files if they are properly copied. Therefore, I was wondering if there were "alternate" methods for copying files in VB. I tried using the My.Computer.FileSystem.CopyFile method, but that just error out saying it could not find the target folder. Is there another method that more closely resembles what happens when files are copied using Windows Explorer?
What I am trying to do is create a form with a button and a list box. When clicked the button will generate a list of 3 or 5 characters that have alternate letters and numbers...eg.
q2h a6j z4p d9k
[Code].....
To complicate things a little, each combination needs to be different, ie. randomised but still according to the 'letter,number, letter' formula. There are plenty of examples of randomising strings such as passwords but I cannot understand how to achieve the above.
I am attempting to make a piece of software that monitors a 3rd party process for injected code. I successfully made a program that uses readprocessmemory from kernel32 to search for strings in a process. My problem is that the process I am attempting to monitor is running as system and provides an access denied message when I attempt to query any information about the process. Including process.handle and process.modules. Are there any ways I can get this process' handle?
I have to admit that I was sceptical it would work... but below is the code. I had to make a minor change to the code you suggested. Whenever I tried IPC$ it would return a 53 result code, even though I'm sure the share exists. So at the suggestion of another website I removed the share and just the computer name and this worked.
I'm looking for a way to change the font colour on alternate rows within a datagrid. e.g. normal row would be green and the alternate row would be blue. I can change either by using me.datagrid.Styles.Row.Forcolour me.datagrid.Styles.AlternatingRow.Forcolour
The problem is that I am having trouble using both of them together as I need to manipulate both colours. I have created a HtmlRowPrepared event and have been setting them there, however, If I set the Row.Forcolour first, it will over ride the AlternatingRow.Forcolour and vice versa. This needs to be done via SEVER SIDE code only as the colour choices are held in the database.
In our application user needs to login to a particular company. We have an option in menu that would let user to select another company while application is open. When user selected other company the application restart itself along with the settings for new company.
Until first load everything was fine and user can select other company from the menu, but when application restarts itself it throw and exception stating Unable to load assembly. Whereas if we again try to run the statement in debug mode everything goes fine. Basically, on alternative loads we are getting this error.[code]...
I am developing a small tool to allow our Windows admins to do stuff like create/delete users, mailboxes and other useful stuff.The current version has to be launched with RunAs as it requires domain admin privileges to do a lot of the stuff. Now, to overcome this I'm trying to incorporate a dialog box that prompts for credentials when the application starts and then uses said credentials throughout the application. I have it working for the AD interaction but one of the tasks the tool needs to do is create folders on a remote server and share them.Is there any way to create folders using alternate credentials? Maybe, once I have the credentials, quit the application and re-launch it with the specified credentials?
building a table from code behind and attempting to change alternate row colors.I have it working but at he moment only using Drawing.Color when I would like to use a hexidecimal value, is there a way of doing this?
Here is the code thats doing it at the moment:
If j Mod 2 = 1 Then r.BackColor = Drawing.Color.Aquamarine 'Table1.Rows(j).Cells(i).CssClass = "odd"
A recent project of mine has been to make a designer. I've finished everything, but when I click the controls to show the properties window, the control interacts with the cursor. So my question is: How do I freeze the controls from interacting with clicking or key presses without disabling the control itself?
I have a program written in VB.net 2003 that are folks run under alternate credentials. Inside the app there is an option to open a UNC path to a network share. We were running Windows XP SP3 and IE6. The code is simple just a call to the explorer.exe with /root,\UNCPath. After installing IE 8 onto the machine this no longer works. Best I can tell the code is still working but now being executed in non interactive mode so nothing opens up. You can however see a new spawned explorer.exe running under the system account for each attempt at opening a UNC Path. Any ideas what IE8 could have done to cause this behavior?
How do you access a link with rel="alternate" using process.start?
Dim Internet As New Process Dim InternetAddress As String = eL(DiUs, 0) Internet.StartInfo.FileName = InternetAddress Internet.StartInfo.WindowStyle = ProcessWindowStyle.Normal Internet.Start()
eL(DiUs, 0) is a link to an RSS, but the post won't show unless the link is rel="alternate". How do I do that?
I am working on the migration of a VB project to C#. This project is using the F1Book (Formula one Active X component) to show the reports and also for saving the data entered by the user.
I am trying to find out its alternate in C#. Which control will be best alternate for this component in C#? As this the main component in VB project, i have to be very careful for choosing its alternate.