Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
ElseIf MousePosition.Y > Screen.PrimaryScreen.WorkingArea.Width - (My.Computer.Screen.Bounds.Height - My.Computer.Screen.WorkingArea.Height) Then 'button
                    Form2.Show()
                    Form2.Size = New System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height / 2)
                    Form2.Location = New Point(0, (Screen.PrimaryScreen.WorkingArea.Height / 1.82))
                Else

'from move event

'the task bar is on the right or left not working right.

'can someone help me please.
Posted
Updated 17-Sep-11 16:01pm
v4
Comments
Prerak Patel 17-Sep-11 22:15pm    
Not clear what you are asking. Add more details to your question.

1 solution

As Prerak has already stated your question isn't clear.

First of make sure your code is as readable as possible. Don't write Screen.PrimaryScreen.WorkingArea.Width it makes your code hard to read when you're doing it a lot of places. And remove code that you know doesn't have anything to do with your problem, like I guess you've done now, after you got no helpful answers for your last question.
Here is how I would have posted your code.
VB
Dim waWidth As Integer = Screen.PrimaryScreen.WorkingArea.Width
Dim waHeight As Integer = My.Computer.Screen.WorkingArea.Height
Dim screenHeight As Integer = My.Computer.Screen.Bounds.Height

' Explain what you're doing before the ElseIf, or write your code snippet so it 
' doesn't matter, e.g. use If instead of ElseIf

ElseIf MousePosition.Y > waWidth - (screenHeight - waHeight)
Then 'button
    Form2.Show()
    Form2.Size = New System.Drawing.Size(waWidth, waHeight / 2)
    Form2.Location = New Point(0, (waHeight / 1.82))
Else
'from move event
'the task bar is on the right or left not working right.
' Those two comments doesn't make much sense to me.


Then when you have made your code as readable as possible. Make sure you state clearly and precisely what your problem actually is. What exception do you get? what behavior are you seeing and what did you expect?

I know English isn't the primary language of many people, including myself, and sometimes it can be hard to explain things, but you have to do your best, explain it in 3 different ways if you're not sure others can understand problem. 3 explanations of the same problem is better than one explanation that no one really understand.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900