|
User Control is only one example name.
Put another name.
First you must reference your control on the form.
In the solution explorer/References/Add references/Select your control
Then you must import your control:
Imports YourControl 'The name of your control
|
|
|
|
|
i know i am reffering my user control not this name(user Control) i have alos added the reference but ist not showing up when i use dim ctrl as new ___ i cannot find that in the list popup. what other way i can refrence. its in my project .
|
|
|
|
|
Verify if your control is Private.
It must be Public if it is a different project
|
|
|
|
|
its in the same project and how can i verify its public or private
|
|
|
|
|
On the first declaration of the class.
Private class YourControl
Change Private to Public
|
|
|
|
|
i may have many usercontrol in a standard exe . its not letting me change the control type to public. if i want to it says change the project to activex control but this is my project with other forms. so dio i have to make my controls in a differnt project. i am not getting it.
pls help
|
|
|
|
|
Now I know what's wrong
The code that I gave you is for Visual Basic .Net.
You must be running VB6.
I can't help you on that.
Sorry!
|
|
|
|
|
Hi,
I'm building a new app (vb6) and I need to open a .txt file and check if in the .txt file it exists a text expression.
How can I do that?
Thanks in advance.
|
|
|
|
|
Private Sub Get24Hours()
Dim strLine, strTmp() As String
Dim lngX As Long
Open App.path & "\REC24-032405120130.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, strLine
strTmp = Split(Trim(strLine), ",")
If strTmp="Your Expression" Then
else
endif
lngX = lngX + 1
Loop
Close #1
Hope this will help
|
|
|
|
|
I am building a deployment project for my Visual Basic application, and I'm having some registry trouble. I'm using the Registry Edition in the IDE to create the registry keys, but a few of my keys include the full path to the application. Since the MSI installer lets to user install wherever they want (I can only recommend an installation location), how can I get full installation location so that I can update my registry keys? Do I have to do a custom action that runs once the installation is finished? Even so, how can I get the full installation path? Thanks.
|
|
|
|
|
You could put in a custom action to put the installation path into the registry.
It would be even easier to change your code to not care about getting that path from the registry. Instead, at runtime, you could use Application.StartupPath to find out where the .EXE was installed to. From there, you could make absolute, or relative, path names to any file that your application needed using the Path class and its .Combine() method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What I'm actually doing is installing a right-click explorer extension so that my application has an action when you right click on the relevant file. Not the default action, but just an action that the user can select (along with "Edit this file", "Print", etc.).
To do that, it's my understanding that I need to add a registry key under that extension in the registry. I've gotten that working fine, and my applications does great if it's installed to the default location, but if they change the location during install, then the registry key doesn't point to the correct location anymore. My right-click custom action is still created and displayed, but the user gets an error when they execute the action, since the EXE file can't be found.
Any ideas?
|
|
|
|
|
This problem has a very simple solution. Windows Installer anticipates the need to determine the actual installation folder during the setup execution for a variety of reasons. The msi includes a builtin property named TARGETDIR that evaluates to whatever the application folder is set to at runtime. So if you need to set a registry key to a file's path in the application folder you can substitute the property using a syntax of [TARGETDIR]. At setup runtime the installer will automatically replace any reference to [TARGETDIR] with the target folder path setting.
The syntax is as follows:
Suppose the user selects install path of "C:\Program Files\Your App Target"
If you define a registry key and set the value to:
[TARGETDIR]
the installer will create a key with a value of "C:\Program Files\Your App Target".
If you define a registry key and the set the value to:
[TARGETDIR]\MyApp.exe
the installer will create a key with a value of "C:\Program Files\Your App Target\MyApp.exe".
Robert
|
|
|
|
|
Thanks - this is exactly what I was looking for! I saw the "[Manufacturer]" tags in the Registry Editor, but I didn't even think that there might be other tags that would be replaced when the application was installed.
Is there anywhere that a complete list of these tags (or whatever they're called) can be found? I'd like to know if there are any others that might make my package run a little more smoothly or allow some additional customization during the install process.
Thanks again!
|
|
|
|
|
Ryan McCauley wrote:
Is there anywhere that a complete list of these tags (or whatever they're called) can be found? I'd like to know if there are any others that might make my package run a little more smoothly or allow some additional customization during the install process
Download the Windows Platform SDK. It contains documentation of Windows Installer technologies and various tools that allow you to modify the MSI packages created in VS IDE.
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en[^]
Robert
|
|
|
|
|
I have a dataset of user names and I need to search the main DOMAIN to see if that name is still available. If not, then I am to delete that user off my User table (Oracle db).
Note that I don't want to locate the current user's domain information (which I could use the SYSTEM.ENVIRONMENT for), but I want to get domain information about someone else (or in this case many someone elses in a loop).
How can I do this? I would appreciate any help.
Thanks and regards
Sean
|
|
|
|
|
Hi,
I have constructed a Datagrid with 15 columns.
I want the horozontal scrollbar to start from the 6th column.so that 0-5 columns remains static and the rest of the columns [6-15] scrolls upon dragging the scroll bar.
another thing is : i have 3 datagrids. If i drag the horizontal scroll bar of the first grid the other 2 grids columns should also automatically scrolled in proportion of the first grids scrolling.
it will be highly helpful if any one provides me a solution with sample coding.
tu.
tinu anand.
|
|
|
|
|
Hi all,
I'm working on a project that using vb.net.
There is an existing screen name MPN Print in the project that is specially used for batch printing.
However, I need to create a windows service using vb.net that have the same function as MPN Print screen so that the program will run automatically once the computer being start up.
My problem is, I have no idea and confuse to work on the wondows service.
-Do i need to cut the existing codes of MPN Print screen and paste it in the windows service(service.vb)?
-Or maybe there is a way or a specific function that can be used in order to retrieve code's of MPN Print from the service.vb?
Can someone give me guide to find the solution?
besah
|
|
|
|
|
The selectitems is a collection.
How to get the value of a selected item?
Thanks!
|
|
|
|
|
Hi!
I don't know if you're using multiselect or not but if you are not then you can only have one element selected so, you obtain the item by doing
MyListView.SelectedItems(0)
If you have multiselect = True then you can do this:
Dim MyListViewColl As SelectedListViewItemCollection = MyListView.SelectedItems
Dim MyListViewItem As ListViewItem
For Each MyListViewItem In MyListViewColl
(...) 'do whatever you want with the object
Next
Never say never
|
|
|
|
|
Sir,
i would like to know on how to convert the hexadecimal string to the text messages using vb?
Because when i receive the sms from the mobilephone using AT command,the sms is in hex..so i cnt understand it.
May i know what is activeX and sms.OCX means and what is the function (the use of it)?
Thank you
|
|
|
|
|
In the click event sub of a winfor, how to judge it is a left click or a right click?
|
|
|
|
|
Hi!
The Click event gives doesn't give you any kind of information, basically it only tells you that you clicked in a control. In your case, because you need to know if it was a left or right click you should use the MouseDown and/or MouseUp events because the MouseEventArgs object gives you that and another information.
Never say never
|
|
|
|
|
I am sending a message using MSMQ to a network computer. i am able to send the message without any error, which i can confirm from my Outgoing Queue.
Now the problem part:
Even though the Outgoing Queue is showing that i am sending the messag, but it is not showing the Queue Message which i am sending. And i the other system's Queue is also empty. Below is the code i am using. Correct me if i am wrong.
Dim mq As MessageQueue = New MessageQueue
Try
mq.Path = "FormatName:Direct=OS:IP-Address of the system\Private$\ABC"
mq.Send("hello")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
I have solved the problem, i was passing the IP address, instead i should have passed the AD name. Now it's working"
Now i am trying to get the acknowledgement of the message and this is what i am trying
Dim msg As Message = New Message
msg.AcknowledgeType = AcknowledgeTypes.FullReachQueue
msg.Body = "Hello"
now i am not sure i am getting any acknowledgement. I think that i should get an empty message in my queue as acknowledgement. Correct me if iam wrong
|
|
|
|
|
Requirement:
Need to download a csv file from a password protected site. That site uses their own (form’s) authentication procedure (i.e. not Windows authentication). That site uses cookies to store the user details.
Procedure:
Currently we are trying to submit a request to the login URL with all the values (passing all the hidden parameters and etc.) and get the cookie from the response. We are trying to make use of the cookie the in our next request to the desired the file.
Problem:
The above procedure works at some times and not at all the time. Is there any thing wrong with the procedure, or is there any other easy way to do the same.
Actually I got this code sample from site only.
Code Part:
Classes needs to be included
Imports System.Net
Imports System.io
Imports System.Runtime.InteropServices
Private Sub screenScrapingCode()
Try
Dim wp As New WebProxy(sreverURL, intPORT) ' Creating proxy with server as "10.237.3.28" and port as 6050
Dim nc1 As New NetworkCredential(UserName, Password, Domain) ' Setting the login credentials for the proxy
wp.Credentials = nc1
Dim hr As HttpWebRequest
hr = WebRequest.Create(LoginURL) 'Creating the request for the login screen
hr.Proxy = wp
hr.Method = "POST"
Dim str As String ' hidden parameters and other values to be submitted as a string
str = postData
Dim cookies As New CookieContainer ' Cookie Container to have the cookie collection
hr.CookieContainer = cookies
Dim requestwriter As StreamWriter
requestwriter = New StreamWriter(hr.GetRequestStream())
requestwriter.Write(str) ' writing the form datas to the request object
requestwriter.Close()
Dim hres1 As HttpWebResponse
hres1 = hr.GetResponse()
Dim cooki As CookieCollection
Dim url As String
url = hres1.ResponseUri.ToString()
cooki = hres1.Cookies() ' getting the cookie from the other site
hres1.Close()
Dim filename As String ' path and filename to save the downloaded file
filename = "Data_file.html"
filename = stringFilepath + filename
Dim hr1 As HttpWebRequest
hr1 = WebRequest.Create(url) ' creating the request for the csv file
hr1.Proxy = wp
hr1.CookieContainer = cookies
cookies.Add(cooki) ' adding the cookie to the next request
Dim hres As HttpWebResponse
hres = hr1.GetResponse
Dim stream As System.IO.Stream
stream = hres.GetResponseStream
' writing the data into a file
Dim writeStream As New FileStream(filename, FileMode.Create, FileAccess.Write)
ReadWriteStream(stream, writeStream)
stream.Close()
writeStream.Close()
hres.Close()
Catch ex As Exception
End Try
End Sub
Private Sub ReadWriteStream(ByRef readStream As Stream, ByRef writeStream As Stream)
Dim Length As Integer = 256
Dim buffer(256) As Byte
Dim bytesRead As Integer = readStream.Read(buffer, 0, Length)
While (bytesRead > 0)
writeStream.Write(buffer, 0, bytesRead)
bytesRead = readStream.Read(buffer, 0, Length)
End While
readStream.Close()
writeStream.Close()
End Sub
Regards,
Varathu
|
|
|
|