|
First of all when you draw the image yourself you shouldnt assign the BackgroundImage property. Instead leave it nothing and store the image in some private variable of your own.
Also you shouldnt have the same code in your Paint and Resize event. Instead of drawing the image in the Resize event I would try to call Me.Invalidate(). This will cause repainting of the form.
Havent tried this, but I think it should work.
|
|
|
|
|
Ok thank you Invalidate work but this is very slow. My Paint methode looks like :
e.Graphics.DrawImage(Me.BackgroundImage, 0, 0, Me.Width, Me.Height)
I think that the method "DrawImage" is very slow ...
how can i improve that?
Thanks again!
Dany
|
|
|
|
|
To say it again:
Dont use the BackgroundImage property when you are drawing the image youserlf. If you do this the form will paint the background (beacuse of the property) and after it you draw it int the paint event handler. This should make it a bit faster.
But I dont know of any faster method (then DrawImage) to paint a bitmap on a form.
|
|
|
|
|
hi can any one suggest me what should i do to make application works fine with any resulion
|
|
|
|
|
Design the GUI at the lowest screen resolution you anticipate the app will be used at and you will have no problems at higher resolutions.
|
|
|
|
|
but right now i m working in 800 by 600 pixels and when i run the app dev for this resolution at 1024 by 768 pixels then there r so many blank spaces on the form coz controls size is very small at 800 by 600 so in 1024 by 768 mode its locks so many blank spaces on forms
|
|
|
|
|
Have you tried doing
Me.Scale = 1
By doing this all items on the form will remain the same size with respect to your form. Also the form will be in the same proportions with respect to any resolution.
|
|
|
|
|
hi! i need 2 create a network monitoring tool in VB for my uni coursework..nothing too fancy, but with at least the basic functions you'd expect.....sounded easy enough, but i have no idea where 2 start! any recommendations of where i can get help to start up? have come 2 a bit of a dead-end lately! ANY fresh input would be appreciated beyond belief!!!
Many thanx!
|
|
|
|
|
Mita22 wrote:
but i have no idea where 2 start!
Then why did you even consider this project? You've got alot to learn in a short time...
You can start by checking out the WinCap library[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi I have a small VB app that I want to add a button to that when the user clicks on this it launches Windows Computer Management.
I Found out that you can use:
CreateObject("WScript.Shell").Run "compmgmt.msc"
and this will connect to the Computer Management on the local machine, but I want the Computer Management tool to connect to a remote machine that the user can specify from a input box
Anyone know how to do this?
Thanks
|
|
|
|
|
WMP10
I am writing code for a DVD/Video player using the WMP10 SDK. I want to use the WMPLib.iVideoCtrl interface since it contains all the features to change aspect ratios, contrast brightness etc. However, I am unable to find a way to use this interface. I cannot find an interface in the WMP player object that can link this interface i.e.
Dim vc as WMPLib.iVideoCtrl 'May need New, cant remember
Dim pl as new WMPLib.IWMPPlayer4
vc = pl.?
Also is there a way to navigate through the DVD menu using code rather hovering the mouse of the video?
WMP6.4
How do I play DVDs in this player. MSDN says that by saying
filename = "DVD:" , it should play dvds. Anyone have any luck playing with that?
Thanks
|
|
|
|
|
i had made a fontbox classs
and added a button "apply" using "showapply()" method
but i can't use it as like others"yes" or "no"
i cant check dialogbox result
here is my code
font_box1.showapply()
if font_box.showDialog()=dialogresult.apply()(problem here)
|
|
|
|
|
Hello,
The FontDialog Class has an event handler called FontDialog.Apply. It will be triggered once the Apply button is pressed.
[Edit]
Here's the code that I used for the detecting when the Apply button is pressed:
Private Sub FontDialog1_Apply(ByVal sender As Object, ByVal e As System.EventArgs) Handles FontDialog1.Apply
MessageBox.Show("Apply button was pressed!")
End Sub
[/Edit]
I hope this helps,
Programmer2k4
My sig:
"The so-called 'Bugs' do not exist, they are merely features hidden by developers with message boxes that say 'An unhandled exception has occurred'." - Programmer2k4
"And it is a professional faux pas to pay someone else to destroy your computer when you are perfectly capable of destroying it yourself." - Roger Wright
I now use my CodeProject Blog!
|
|
|
|
|
I have 7 images entering a form in VB.net via the use of label.image and would like to know how it could be possible to make the images that i have placed come in one after the other rather than all at once.
My code for image placement look like this for arnumbers() = 0-6 and label from 1 to 7
Label1.Text = arnumbers(0)
If Label1.Text <= 10 Then
Label1.Image = MyImage3
ElseIf Label1.Text > 10 And Label1.Text <= 20 Then
Label1.Image = MyImage4
ElseIf Label1.Text > 20 And Label1.Text <= 30 Then
Label1.Image = MyImage5
ElseIf Label1.Text > 30 And Label1.Text <= 40 Then
Label1.Image = MyImage6
Else
Label1.Image = MyImage7
End If
I hope someone can help.
Jarlath Eoin Gallagher
|
|
|
|
|
I assume this is a loop of somekind.
What i think you need to do is either refresh the label at the end of the loop.
label1.refresh
and set some sort of timer delay in between changing the image.
From the info given that is the best i can do.
"If i was king cigarettes would be free."
|
|
|
|
|
I have a toolbar on form, i set some images to image list, then i set it to toolbar. In Design Time, i see images on Toolbar buttons. But they are not visible at run time. What s Wrong.
NOTE : first I used Application.EnableVisualStyle then i commented it. it doesnt work in both situation.
|
|
|
|
|
i attach a datetime picker control the form. Then i display a message on its "TextChanged"event. Here is the code.
Private Sub DateTimePicker1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DateTimePicker1.TextChanged
Msgbox("Code Runs")
End Sub
Means this code will display a message when i change any day from the datetime control. But when i changed the month, then it display message 30 times, and when i change year, it display my message 365 times.
I need that when i change the month and year from this controls, then it cannot display message. It only display message when i change the day. How can i do this.
plz help
EsHbAn BaHaDuR
|
|
|
|
|
Hi,
I am trying to send an email using VBScript. I have managed to write code to send the email, and include an attachment. I have currently got the following vbs code:
______________________________________________
Dim objOutlook
Dim objOutlookMsg
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "Recipient Name"
.Cc = " "
.Subject = "Updates Notification"
.Body = vbCrLf & "The documents listed in the attached text file have recently been updated" & vbCrLf & vbCrLf
' .HTMLBody = "HTML version of message"
.Attachments.Add ("C:\Update Notification\Text.txt")
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
_____________________________________________
Now, I am trying to put the contents of the text file into the body of the email (instead of attaching the text file into the email)
If viable, anyone know how to do it?
Any help will be much appreciated....thanks!!
|
|
|
|
|
Easy. Use a FileSystemObject to OpenTextFile. This will return a TextStream object. Use the ReadAll method to read the contexts of the file into a variable, then close the file. Tthen you just append the contents of the variable to the Body of the message.
ReadAll Method[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
Thanks alot for the help....much appreciated!!
Read the link you put in the reply.
Now have the following code, which does the trick:
_________________________________________________
Function ReadTextFileTest
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f, Msg
Set fso = CreateObject("Scripting.FileSystemObject")
' Set f = fso.OpenTextFile("C:\Update Notification Code\Text.txt", ForWriting, True)
' f.Write "Hello world!"
Set f = fso.OpenTextFile("C:\Update Notification Code\Text.txt", ForReading)
ReadTextFileTest = f.Read(9999)
End Function
Dim objOutlook
Dim objOutlookMsg
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "Email Address"
.Cc = ""
.Subject = "Update Notification"
.Body = vbCrLf & "The documents listed below have recently been updated:" & vbCrLf & vbCrLf & ReadTextFileTest & vbCrLf
.Importance = 2 '0 = low, 1 = normal, 2 = High importance
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
_________________________________________________
Any ideas on how to make it more efficient?
Thanks alot once again.
|
|
|
|
|
Un-Connected wrote:
Any ideas on how to make it more efficient?
What do you mean by "more efficient"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
i need to view a html(say abc.html) in my form and compare it to another html . both these should be placed side-by-side. i need to add synchronized scrolling to these.
any inputs?
thanks
|
|
|
|
|
Using VS.net 2005, the PictureBox in WinForm could not show pictures.
Why?
|
|
|
|
|
rushing wrote:
Using VS.net 2005, the PictureBox in WinForm could not show pictures.
Why?
Can you be more descriptive please. If I asked they question "Using Toyota Yaris, the engine won't start. Why?" how much of a useful response do you think I will get.
What code are you using to try and display the pictures?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
1 Create a project
2 Using a winform
3 drag a picturebox to the winform
4 select the picturebox
5 select the property of image
6 select a jpg or bmp file for the picturebox
7 nothing happened , picture could not be seen
8 that's all
|
|
|
|