Click here to Skip to main content
15,905,781 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using the Black Box method in C# Pin
Brian_TheLion5-Mar-19 11:47
Brian_TheLion5-Mar-19 11:47 
AnswerRe: Using the Black Box method in C# Pin
Gerry Schmitz5-Mar-19 8:10
mveGerry Schmitz5-Mar-19 8:10 
GeneralRe: Using the Black Box method in C# Pin
Brian_TheLion5-Mar-19 11:45
Brian_TheLion5-Mar-19 11:45 
GeneralRe: Using the Black Box method in C# Pin
Gerry Schmitz6-Mar-19 4:13
mveGerry Schmitz6-Mar-19 4:13 
GeneralRe: Using the Black Box method in C# Pin
Brian_TheLion6-Mar-19 11:32
Brian_TheLion6-Mar-19 11:32 
Questionc#, winforms, moving the app to another monitor and updating the screen device name Pin
jkirkerx4-Mar-19 7:01
professionaljkirkerx4-Mar-19 7:01 
AnswerRe: c#, winforms, moving the app to another monitor and updating the screen device name Pin
jkirkerx4-Mar-19 7:15
professionaljkirkerx4-Mar-19 7:15 
GeneralHow to center a progress bar dialog across multiple monitors Pin
jkirkerx4-Mar-19 9:44
professionaljkirkerx4-Mar-19 9:44 
I just writing this in case I need to go back and figure it out again. So far it works pretty good but I'm sure there's a better way of doing this. Well the idea is that if you have multiple displays, 2 or 3 running horizontal, and you keep moving the app around to a different monitor, or overlapping 2 monitors, and you want to get your progress dialog centered in the application. I tried a whole of ways of doing this, but the parameters I saved on the main form when changed, would not update when accessing it from the progress dialog.

So I took my global class and added a Rectangle to it. I wrote this in VB but used this forum to ask the question.
Friend Module Global360

    Public Property GOnline As Boolean
    Public Property MfRectangle As Rectangle

End Module
Then on the MainForm in the Event Location Changed, I added this
If mainForm.WindowState = FormWindowState.Minimized
    Global360.MfRectangle = Rectangle.Empty
Else
    Global360.MfRectangle = Nothing
    Global360.MfRectangle = new Rectangle(mainForm.Left, mainForm.Top, Me.Width, Me.Height)
    Application.DoEvents()
End If
And in the Progress Dialog, I wrote this in Form New
If (Global360.MfRectangle <> Rectangle.Empty) Then
    Me.StartPosition = FormStartPosition.Manual
    Me.Top = ((Global360.MfRectangle.Height - Me.Height) / 2) + Global360.MfRectangle.Y
    Me.Left = ((Global360.MfRectangle.Width - Me.Width) / 2) + Global360.MfRectangle.X
Else
    Me.StartPosition = FormStartPosition.CenterScreen
End If

I'll change the code as soon as I get it working in C#
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: c#, winforms, moving the app to another monitor and updating the screen device name Pin
Gerry Schmitz5-Mar-19 8:24
mveGerry Schmitz5-Mar-19 8:24 
GeneralRe: c#, winforms, moving the app to another monitor and updating the screen device name Pin
jkirkerx5-Mar-19 10:37
professionaljkirkerx5-Mar-19 10:37 
QuestionPlease tell me what is wrong with this simple C# program Pin
Brian_TheLion3-Mar-19 23:20
Brian_TheLion3-Mar-19 23:20 
AnswerRe: Please tell me what is wrong with this simple C# program Pin
OriginalGriff3-Mar-19 23:46
mveOriginalGriff3-Mar-19 23:46 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Brian_TheLion4-Mar-19 0:02
Brian_TheLion4-Mar-19 0:02 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
OriginalGriff4-Mar-19 0:05
mveOriginalGriff4-Mar-19 0:05 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Brian_TheLion4-Mar-19 0:37
Brian_TheLion4-Mar-19 0:37 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Richard MacCutchan4-Mar-19 0:41
mveRichard MacCutchan4-Mar-19 0:41 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Richard MacCutchan4-Mar-19 0:43
mveRichard MacCutchan4-Mar-19 0:43 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Brian_TheLion4-Mar-19 1:05
Brian_TheLion4-Mar-19 1:05 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
Brian_TheLion4-Mar-19 0:41
Brian_TheLion4-Mar-19 0:41 
GeneralRe: Please tell me what is wrong with this simple C# program Pin
OriginalGriff4-Mar-19 0:47
mveOriginalGriff4-Mar-19 0:47 
QuestionWhat is free alternative to microsoft bot framework? Pin
Nitin S3-Mar-19 21:14
professionalNitin S3-Mar-19 21:14 
AnswerRe: What is free alternative to microsoft bot framework? Pin
Richard MacCutchan3-Mar-19 21:46
mveRichard MacCutchan3-Mar-19 21:46 
AnswerRe: What is free alternative to microsoft bot framework? Pin
Eddy Vluggen4-Mar-19 0:36
professionalEddy Vluggen4-Mar-19 0:36 
QuestionC# Code converted from Java gives error using in Script Task in SSIS Pin
Member 141699203-Mar-19 18:42
Member 141699203-Mar-19 18:42 
AnswerRe: C# Code converted from Java gives error using in Script Task in SSIS Pin
OriginalGriff3-Mar-19 19:56
mveOriginalGriff3-Mar-19 19:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.