|
Trying to find some basic programming help = adding icons to menus and changing the background color of menus. Have seen this done but can't find any examples.
Found one reference on this site "Adding Icons to Menus" by Willian.BR but apparantly it is a broken link.
Any suggestions or help appreciated!
billp@awalnet.net.sa
|
|
|
|
|
It can be done, but not within VB6 code. See the following articles and projects for helper .DLL's that will do what you want, especially the first one.
Yahoo Search Results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i have tried to add a track bar control to my project, in vb.net, using the code provided by the msdn, however, it doesnt seem to work, it is not accepting the values nor is it saving them back to the xml file
any ideas?
|
|
|
|
|
if you are using the application.config.xml with the property, it wont write to the file. It will only read from the file when you load the application. You can manually change the XML file for it to change the value.
Hope it help.
anghp@yahoo.com
Feel free to email or yahoo messenger.
|
|
|
|
|
actually i am using the writeXml after each addition, and the problem is i want the user to make the changes.
this is not working with the add/delete buttons as well... as i can view the temporary changes however it is not changing the actual xml file
|
|
|
|
|
Okay, I was thinking about making a kind of media player in Visual Basic .NET that I could call my own...but the problem was I don't know how to insert a control that let a user control the sound! I would be able to in VB6 maybe, but .NET isn't the same. Could someone pleeeeeease help?
|
|
|
|
|
If you want to insert a control (activeX perhaps), right click at the toolbar, select add/remove items then select comp object.
Hope that is what you want.
anghp@yahoo.com
feel free to email or yahoo messenger.
|
|
|
|
|
This is the code, just paste it into a form with 1 command button.
Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim media As OpenFileDialog = New OpenFileDialog
media.RestoreDirectory = True
If media.ShowDialog = DialogResult.OK Then
Dim waveFile As String = media.FileName
Dim extension As String = System.IO.Path.GetExtension(waveFile)
If (extension.ToLower() = ".wav") Then
PlaySound(waveFile, 0, &H8)
End If
End If
End Sub
hope that help.
anghp@yahoo.com
Feel free to email or yahoo messenger.
|
|
|
|
|
Guyz,
I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do.
Thnx!
|
|
|
|
|
You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.
|
|
|
|
|
A better method (object orientated etc.) would be to use IsInstanceOf e.g. to find out if MyObject implements the interface IMyInterface use the following code.
GetType(IMyInterface).IsInstanceOfType(MyObject)
|
|
|
|
|
Can anybody suggest a good way to display images in a directory? I would like to be able to display a small (thumbnail) view of the image and then click on the image to open it up in a PictureBox.
I’ve been trying to create a ‘Windows Explorer’ type setup where images in the directory that is open in a TreeView would be displayed as thumb nails. Since I’ve had no luck with that, I’m trying to re-group and find a different way to display the images.
Thanks
Brad
|
|
|
|
|
I suggest you use the Image Class provided by the .Net framework. It has a GetThumbnailImage method the you can use to display thumbnail images. Good Luck!
|
|
|
|
|
I have two listbox controls on the same form that I have populated using an arraylist created from an xml file. When I execute the form, the information appears in the list boxes as it should; however, when I make a selection in one of the list boxes, the selected value in the other changes.
Also, When I go to print out the selected values using:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label3.Text = "Creating Test For " & ListBox1.SelectedValue _
& ":" & ListBox2.SelectedValue & ". Please Wait..."
Label3.Visible = True
End Sub
I get the selected value of the Listbox2 in both inserted places.
When I created these on the form I did not copy paste one from the other, I dragged two new listboxes onto the windows form.
Other things to note. I did populate the two listboxes using the same arraylist object after clearing it using:
xmlDoc.Load("../xml/BatchConfig.xml")
xmlNdList = xmlDoc.GetElementsByTagName("Unit")
For i = 0 To xmlNdList.Count - 1
arlAL.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox1.DataSource = arlAL
arlAL.Clear()
xmlNdList = xmlDoc.GetElementsByTagName("Phase")
For i = 0 To xmlNdList.Count - 1
arlAL.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox2.DataSource = arlAL
What gives?
|
|
|
|
|
What you did was bind ListBox1 to a datasource, then you cleared out that datasource and entered new information into it. So, yes, both istBoxes will have the same information behind them. The information from a datasource is not copied into the listbox, it is BOUND.
The solution is to create to diferent arrays and bind them to their respective listboxes.
'I'm assuming you Dim'd an ArrayList as arlAL...
Dim arlAL1 As New ArrayList()
Dim arlAL2 As New ArrayList()
xmlDoc.Load("../xml/BatchConfig.xml")
xmlNdList = xmlDoc.GetElementsByTagName("Unit")
For i = 0 To xmlNdList.Count - 1
arlAL1.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox1.DataSource = arlAL1
xmlNdList = xmlDoc.GetElementsByTagName("Phase")
For i = 0 To xmlNdList.Count - 1
arlAL2.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox2.DataSource = arlAL2
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please help me ! Can you show me the codes that allow one to access the parallel port both the read and write operations by using visual basic.net programming
|
|
|
|
|
You can't do it directly because the O/S abstracts the hardware from software. You need a cute little driver to do the work for you. See http://www.logix4u.net/[^] for a good start.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, thanks for ur reply. But, I found an information as below,
" To write data to LPT1, use the following code:
Success = WriteFile(hParallelPort, Buffer, Buffer.Length, BytesWritten, IntPtr.Zero)"
In this statement, the author didn't mention about the read operation. Do sir know it?
As sir reply,
is there compatible to implement in visual basic.net?
The dll file can use in vb.net?
All the code in that site can use in vb.net?
Thanks for your help, thank you very much!!!
|
|
|
|
|
I wrote a small program in VB6 where my mails should be sent to the recepient. But my program puts my mails in the outbox only. I have to go to outlook express then click on Send/Receive button then my mails go to sent items folder. But this is not the right way, I wanted my program to send the mails directly to the recepient. I used mapi controls for this program.
Is there any other i can do by making reference to COM component or by using any APIs.
plz, help me out.
Thanx,
Ravi.
|
|
|
|
|
check www.planetsourcecode.com[^]
select visual basic category then write smtp in the search box..
i've got many results this way.
|
|
|
|
|
I've written a DLL in VC6 (C++), and I think it's going to be used by a VB programmer. Knowing this ahead of time, I return variants from all exported functions.
I've tested the DLL with a C++ program, but I don't have VB installed and don't care to install it.
1) What do I need give the VB programmer in terms of info about the exported functions in the DLL?
2) Can someone here download and try the DLL in a VB program? If so, go here to download the DLL (includes the C++ test program source):
http://www.paddedwall.org/john/programmer/code/d3dlltest.zip
[EDIT] I correct the html link problem. [/EDIT]
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Helo, this is some problems occurs. Anyone can help?
1. How to get the current directory of the application.exe when I installed the application?
2. For "shell" command, if i am calling app.exe, do i need to specify the path?
3. How to make the close button to be hide button. I mean the close button that come with VB.Net is automatically function as close the form, i want to change it into hide button, which hide the form. How could i do that?
4. I have specified a form that the showintaskbar to false and the windowstate to minimized, but when i click the notify icon, which is set the showintaskbar to true and windowstate to normal, it only works for the showintaskbar, it doesn't work for windowstate. The form won't display unless i set to maximize. How can be like this?
Thanks...
Learning .NET
|
|
|
|
|
1. Use Environment.CurrentDirectory
2. "shell" command? Do you mean you are using the Process class to start an application?
3. Handle the Closing event on the form and set the Cancel property in the event arguments to true. Then you can provide your own behaviour.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
2. It's usually a good practice to specify the full path to the app you want to launch. That way, you leave nothing to chance that the app can't be found.
3. Be careful how you implement this. If you just cancel the close event constantly, your app will never quit. This will stop Windows from restarting and shutting down. You'll have to override WndPrc and watch for the WM_ENDSESSION message. When you receive this message, you should set a flag in your code that is checked upon the Close event firing. This will tell you wheather or not you should really close your app or just minimize it.
4. This is normally because your window's normal state size is essentially 0 by 0. Try setting the size of the window to known values before you set it's state to normal.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
mythinky wrote:
3. How to make the close button to be hide button. I mean the close button that come with VB.Net is automatically function as close the form, i want to change it into hide button, which hide the form. How could i do that?
Adding the following to your form should do the trick:
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Const WM_SYSCOMMAND As Integer = &H112
Const SC_CLOSE As Integer = &HF060
If m.Msg = WM_SYSCOMMAND AndAlso m.WParam.ToInt32 = SC_CLOSE Then
Me.Hide()
Exit Sub
End If
MyBase.WndProc(m)
End Sub
–Marty
|
|
|
|