I have several images in my My.Resources i wish to load the images into a user controle i wish to change the image loaded into the card control at each pass of the for net loop to make my own deck. but i can not change pdeck(c).face = CType( My.Resources.he10, System.Drawing.Image)
I would like to believe that this code will display a horizontal line halfway across the PictureBox pbxData. In fact, what it does is create the BitMap and then blow up with a memory violation when trying to copy the BitMap into the PictureBox. The code that alters the array is commented out because I don't know how to address the elements of the array.
how to make this into useful code?
Imports System.Runtime.InteropServices Public Class Form1 Private b1 As Bitmap
So I am having an issue where I want to call a variable without addressing it directly and I get an error for it:
Conversion from string "player1BuzzLock" to type 'Boolean' is not valid.
This is technically correct but why would it fail?
Dim player1BuzzLock As Boolean = False Dim PlayerNum as Integer = 1 '... Dim playerBuzzLock As Boolean = CType("player" & PlayerNum.ToString & "BuzzLock", Boolean)
I am trying to load a GIF file by its string name from my.resources as what GIF to show is chosen at random and based off that random number we get a valid string name. The names come out proper because I used the Msgbox trick
Here is my faulty coding
Public Function PrintCardName(ByVal Suit As String, ByVal Hand As String, ByRef ImgBoxUpdate As System.Windows.Forms.PictureBox) 'Working code omitted to save reading time ImgBoxUpdate.Image = My.Resources.ResourceManager.GetObject(Card_File_N ame) End Function
And Card_File_Name is a predefined string, and no there is no space after the letter N in card_file_name it just appears that way because its italicized The issue is that the Imagebox that is referanced to IMGBOXUPDATE goes blank after this function.
I know that if you create a string like:dim a as string = "My String"if you open the compiled .exe in a hex editor you will see there "My String"now my question is about the Resources:if I add a string there, how easy would be for one to have access to it?Is it a plain xml that anyone could see or does it stay pretty hidden?
I simply cannot refer to a control on a form from module code as in all other versions of VB. Here is the code that I mean:[code]The fact that this cannot seemingly be done without getting into looping through an array of controls, assigning the control to a general control variable etc. and much more guff is puzzling and is in my opinion an added complexity to Visual Basic. There must be a simple way to do this - I just want to refer to the value in a control, on a form, from a module.
I am working on a custom bulletin board system for my company. The idea is to have a program running that displays a full screen bulletin board on many monitors around our facility. I wrote a VB client that pulls from a server and displays a single board perfectly - I am wondering how to expand this.
recent thread, there was a passing discussion regarding running Rick's program in a background worker in order to keep the user interface "alive". The thread was actually about memory usage, so I decided to put this together instead.First, I'm sure no expert at any of this, so do take all of this "as is" and with a healthy dose of skepticismThebackground worker is a fairly easy way to let your program run time-consuming or complex operations on another thread so that your main thread (your user interface) stays active. This can be done other ways of course, but the BGW has many things builtinto it that makes it ideal to use for just this sort of thing.
One caveat to keep in mind is this: You cannot directly "talk" from the BGW to your main thread or you'll get a cross thread violation exception. As an example, you cannot set a label's text value (on the form, thus on your main thread) from the BGW, butyou can modify class-level variables then in the BGW's Progress Changed event, it will update that text based on the variable.In this example I'm doing this two ways: The first is a calculation of the percentage done (so that I can display it textually and in the progress bar), and the other is text indicating the status.
In vb.net, you can address a public variable from another form using the form name along with the variable.
form2.show form2.k = 3
However, if you use a form variable to show an instance of the form, you must use that variable name to address the public variable. Two instances of the same form are displayed in the following example. The public variable k is assigned a value of 3 only in the first instance of the form, the one from form2.show. frm.k can be used to assign a value to the other form.
dim frm as new form2 form2.show frm.show form2.k = 3
Assuming only one instance of the form is shown in the application, is it reliable to address a public variable using the form name (form2.k), or is it better to show the form with a form variable and use that to refer to the instance of the form (frm.k)? Would the same answer apply to a property as well as a public variable?
Developing a multilingual application in VB.Net 2008, Im able to add resources to forms and create a multilingual forms depending on uiculture. On reading Msdn on creating the multilingual string values for messagebox contents, have added the .resource file to the project files path as specified. There is no error on compilation but throws the MissingManifestResourceException error
Dim rm As ResourceManager rm = ResourceManager.CreateFileBasedResourceManager("strFormResources", ".", Nothing)
[code].....
There is strFormResources.resources and strFormResources.fr-FR.resources in Resources of the project. I have searched for this error details but could not find a solution. What am i doing wrong or is there any other method for displaying multilingual strings in the messagebox.
i'm unable to debug my project that i made. i save it and everything, but it just won't playit says Warning 1 Could not find type 'WindowsApplication1.My.Resources.Resources, Time table'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built. C:SchoolIPTTime table, using 2 loopsTime table, using 2 loopsForm1.Designer.vb 123 0 now when i open it up and try to debug it , it comes up with an error, i even try referencing it but it does nothing ,
"C:\Trunk_Dec16\bin\x86\Debug\resource.en-US.resources" "C:\Trunk_Dec16\bin\x86\Debug\resource.zh-CN.resources" are 2 strings for which the CultureID's 'en-US' &
The reason I ask is that I want to print, at run-time, a file in the application's resources, like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim printProcess As New Process printProcess.StartInfo.FileName = "C:UsersGeoffrey van WykDocumentsCountdown_Timer_Help.rtf" ' printProcess.StartInfo.FileName = My.Resources.Countdown_Timer_Help printProcess.StartInfo.Verb = "Print" printProcess.Start() End Sub
The reason I ask is that I want to print, at run-time, a file in the application's resources, like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim printProcess As New Process printProcess.StartInfo.CreateNoWindow = True
[code]....
When I use "C:UsersGeoffrey van WykDocumentsCountdown_Timer_Help.rtf" as the argument of FileName, it works. But when I use My.Resources.Countdown_Timer_Help, it says it cannot find the file.
I cannot work out the correct formatting of the above type addressing for a textbox in a (sort of) array of textboxes such as
textbox_1 textbox_2 textbox_3 etc.
The controls are on Tabs but I don't think I need to include the Tab as a container control, just refer directly to the textbox on the form, but I cannot work out how this is done in VB .NET format. In VB6 it was relatively straightforward but VB .NEt seems it is different. Can anyone help me with the correct way to formulate
I am sure this has had to have been answered somewhere but after looking on the web I cant find anything addressing variables in variables. For instance say I have var1, var2, var3, var4 decalred. How can I create a loop assignment? Something like var & i = "variable 1". So instead of "var1" I have the numeric piece be a variable.
error: the item "objdebugassociateassist.frmdbsetup.resources" was specified more than once in the "resourceS" parameter. duplicate items are not support by the "resources" parameter.
I don't understand. Till now this little app was working ok. Error1 The item "objReleaseRadni_nalozi.GlavnaForm.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.Radni nalozi What gives?
Currently I am just assigning my files as strings, and I know this is the wrong way of doing it. If I want my program to read one of my resource files as text, how would I do that?
I've been working with VB for some time using my.resources.I recently installed it on a new computer(Windows 7 ),everything works fine...well almost.
I'm trying to teach my cousin how to change images in an image box using a button.I did it on my computer and it worked,but it wont work on his.Exact same code and images.
Here is what I did:
After having everything set-up I import the 2 images I want to use.
Then inside the click event for the button I write picturebox1.image = my.resources.picture1 "and here is where it doesn't work.It says I don't have any images in my resources named that.Instead it gives me two options Culture and ResourceManager but it doesn't show any of the images I previously imported.
*picture1 is the name of my image
I have no problem with the code(it works),I don't get why it's not seeing the imported images on my cousin's computer.
I need to be able to run a .exe within the resources i have a .exe i built a while back in vb6 and i need to be able to run it from resources so in the final installation build it would run properly on every computer that it installs on.
I am a beginning programmer and having a problem with picture boxes and resources which I want to use on the opening screen/form of a program. I have 4 arrays, each with 25 pictures(JPG); I want 4 pictures to appear on the form and to scroll through them using the form load event or a button. The problem however is I get build errors when I have more than 6 pictures in each array. the pictures load if there are 6 or less; more and it's a problem. I have considered some sort of corrupted picture but have changed pictures and get the same result.Is there a limit to the amount of memory that can be committed to resources?
I have a VB.NET program with lots of embedded resources which are images. Is there a way to get all the resources in an array so I can acces them in a for loop?I currently have to do it this way:
i want to add a image to resources...actually i am giving user facility to add his logo into the report..so i am giving him a picture box to select th image he wants to add..then my question is how can i ad that image to project resources proramatically without erasing previous resources..
Currently i have created another resx file to add logo in it.but there is a threat that user may delete that file if he gets the location of that file..so i wanted to add image into project resources itself..
lets say i have a program that consists of a form and 2 buttons.Now i want to make a theme.I want the background to change and the button background icons to change
(Button1 makes the theme Green and Button2 makes the theme Red)
Suppose i have : C:ThemeGreenButton1green.Picturefile[code]....
ATTENTION: What i want is that the images can also be shown on another pc user that doesn't own them.(Of course this is not the case.I just want to Understand how i can add some files to resources)