|
actually my text1.text= stringtext -- which is a global variable~
|
|
|
|
|
Global variables should be avoided. Nevertheless, in your module declare your string variable with either Public or Friend access modifier (Friend if it's withing the same assembly). Then try dareport1.label12.caption = modulename.variablename
|
|
|
|
|
i'm using vb6, i think dont have friend this command.
It is not working when i put this command
dareport1.label12.caption = modulename.variablename
it said Method or data memeber not found.
I try to check enter the datareport name first then i found that it only link to report properties, can found those label or text in m report...
|
|
|
|
|
I think you misunderstood my code snippet - modulename.variablename is supposed to represent the public variable in the module you are using to populate your data report, I put it in italics for as an example for you as I don't know what you've named the module or the variable.
The point I'm trying to make is, from what I understand, you have a module that populates the data report
Public Module basDataReport
Public strCaption As String '<--- global string variable
Function GetReportCaption()As String '<--- your method that gets report caption
''''''
''' <--- put your processing here e.g.
'strCaption = blah blah blah
'''''''
Return strCaption '<--- string variable with data
End Sub
End Module
Inside whichever method call it is that you're using to set the caption you could call MyReport.Caption = basDataReport.strCaption to get the global variable after it's already been assigned OR if you're using a function like in the example above you could call on the function by name e.g. MyReport.Caption = GetReportCaption() .
See what I mean?
|
|
|
|
|
is ok nvm , i solve my problem with this
<br />
With Vdetail<br />
.Sections("reportheader").Controls.Item("datefrom").Caption = strFromWhen<br />
.Sections("reportheader").Controls.Item("dateto").Caption = strToWhen<br />
End With
|
|
|
|
|
help guys... how can i enter next character in the text box using vb6? it so happen that i'm using hardware - buttons - in this program... using the inpout32.dll and the sort of thing... when i click the button to an specific number then click it again for other number, its just keep on changing the number in the text box - not adding the number that i have click... example: when i click number 1, 1 will appear in the text box, and then i will again click number 2 - the text box should display 12, since i click 1 before, ryt? but in this case, when i click the 2nd number which is 2, it simply replaces the 1st number - which is 1. guyd, can you help me with this? needed it badly thanks!!!
|
|
|
|
|
Try this:
In the code for the button, type:
TextBox.Text = TextBox.Text + Varible1
And replace "Varible1" with what you want to come next.
Hope this helps!
|
|
|
|
|
I am having a problem with the SelectedValue of a list box. I have a List Box that has its data source as a table. The columns in the table are ID and Name. ID is an Integer and Name is a String. I have them bound to the ListBox in this fashion:
ListBox.DataSource = Table1DataSet
ListBox.DisplayMember = “Table1.Name”
ListBox.ValueMember = “Table1.ID”
Whenever I try to use the value member of the list box I get an error. For instance if I declare:
Dim x As Integer = ListBox1.SelectedValue
It says InvalidCast Exeption. If I try to put it as a parameter for a sql query like
MyCmd.Parameters.AddWithValue("@FID", ListBox1.SelectedValue)
It gives an argument exeption when I try to fill my data adpater. Could someone tell me what I am doing wrong.
|
|
|
|
|
Have you used the debugger to see what's in the ID property ? Have you tried Convert.ToInt32 to convert it to an int ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have used
Dim x As Integer = Cint(ListBox1.SelectedValue)
and I still get an error message.
How do you use the debugger to see what is in the ID property?
|
|
|
|
|
Set a breakpoint and type ListBox1.SelectedValue in the watch window.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a VB.Net project, have to some websites, many webpages contain images, take a lot of bandwidth. Does anyone know how to disable image download in web broswer programmtically?
Thank you very much
|
|
|
|
|
You can't disable downloading just certain types of files. It's all or nothing. The web browser control uses the set settings as the user has setup for IE. Changing the settings just so your web browser control works the way you want it to will also change the settings system-wide for every copy of IE that the user has open at the same time.
Also, IE doesn't let you turn off downloading certain file types.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey,
I have one final Registry question. I have scanned the Registry for a couple of hours and cannot figure out how to change the path of where the Bootskin or Logon skin is. It must be possible because I found how to change the Windows theme.
Can anyone help me please? Thank you.
|
|
|
|
|
What are you talking about? What "Logon skin"?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
When you boot up, the screen that you see when you log onto your computer if you have it password locked. (I.e. LogonSkinFile.logon or LogonSkinFile.logonxp).
And the bootskin is what you see when Windows is booting up. (I.e. BootSkinFile.bootskin).
|
|
|
|
|
You can't change the "BootSkin" without resource hacking the NTOSKRNL.EXE file. It's not a seperate file anywhere, it's an image built into the .EXE. I HIGHLY recommend against doing this yourself since you can render your machine unabel to start, even in safe mode. Use an already developed tool if you really want to change that screen. Example[^].
The background you get when the machine is locked specified by the Desktop configuration settings of the .DEFAULT user. Look in the Registry under HKEY_USERS and you'll find "him". The WINDOW that shows up when Windows is locked is generated by GINA.DLL, or a replacement. The only way to replace that window is to create your own GINA.DLL. Don't bother asking me how. It's VERY low-level Windows internal crap and can't be done using VB.NET or and other .NET Managed language.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
I have a class in which I declare and expose all the forms in my application, I wish to have all form load operations/calls to be done by 1 subroutine in my class, thus...
Public Class X
Public Shared frm1 As myForm
Public Shared frm2 As hisForm
Public Shared frm3 As herForm
Public Shared frm4 As ourForm
Public Shared Sub LoadForm(ByRef theForm As Form)
Dim t As Type
t = theForm.GetType
theForm = CType(Activator.CreateInstance(t), Form)
theForm.Show()
End Sub
End Class
The above code will not run because the object "theForm" has not been initialized, and obviously I cna't intialize it w/o knowing which form I am loading, it throws a "System.NullReferenceException" event.
Any idea on how I could detect or get the object type, or type name of an object before it has been created/initialized? The code blows up at the line "t = theForm.GetType", any help is greatly appreciated, thank you.
|
|
|
|
|
This was just answered earlier in the week. You cannot get the type of an uninstantiated class. Besides, the type in your method will always be Form, not the type you passed in.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I get it, I'm SOL... , thanx
|
|
|
|
|
No, you have to take a different approach to a Factory class. It's not good practice to make a a single factory for all different kinds of objects. What you've done in your code only complicates something as simple as:
Dim newForm As New MyForm2
You haven't said anything about why you want to do this, you just said this is the way you want to do it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well, I have one main search form which searches different type of data, say, user info, and company info for example, and in my search form I use one drop down to display the results based on what you searched for, so if you searched for users, then the combo box will show you a list of matching users, if you searched for companies, then you'll get a list of companies in the combo box. I wanted to make it so that when you click on the combo box, the app will call 1 method to load the corresponding form which will display and let you view/edit data. When you do the search I pre-set a val in my app that tells me what type of data we're looking at.
|
|
|
|
|
If someone knows how to do this or knows of a link that shows how it would be appreciated.
I want to link two database tables to two list boxes. For example, I have two tables, one is named State and the other is named City. The column names in State are ‘StateID” and ‘StateName’. The column names in City are ‘CityID’, ‘CityName’, and ‘StateID’ (StateID being the reference between the two tables)
In ListBox1, I want to display the State Names and in ListBox2 I want to display the City Names. When I click on a State Name I want to see the City Names for only the cities in that state in ListBox2. For Example, if I clicked on California I would only see California cities (like San Francisco) in ListBox2.
I want to do this in code and not by using the ide tools in VB 2005. What I am hoping is to put this code into a procedure called ListBoxFill and call this procedure when the form loads. Then if I make any updates, insertions, or deletions to the databases, I can call that procedure again so the changes are reflected in the listboxes.
Does this sound remotely possible or is their a better way to do this.
Thanks.
|
|
|
|
|
Hello everyone, I am hoping someone can help me. I have been working on a small project in VB.Net 2003 and I was doing a good bit of Cut/Copy and pasting some text boxes, labels, etc. Anyway I suddenly have my items on another form with names like TextBox1 and Label3. And the original items are still showing on my Properties Drop down, but they are no where on my form that I can find. How can I get these orphaned items out of the project so I can rename my items correctly? Has anyone ever seen this before?
|
|
|
|