ShowWithoutActivation神秘地不起作用

时间:2016-09-25 15:16:19

标签: vb.net forms

在其他表单/应用程序中使用它没有任何困难。但是,在这种单一形式的应用程序中,它似乎不起作用:

inds <- which(!colSums(!is.na(df1)), arr.ind=TRUE)
## loop over layers and set the appropriate column for each layer
for (i in seq_len(nrow(inds))) df2[[inds[i,2]]][,inds[i,1]] <- NA
df2[]
##        layer.1      layer.2    layer.3     layer.4     layer.5   layer.6
## [1,]          NA  7.707085465 -2.0024253  6.11057171  8.04482952 10.135710
## [2,]          NA           NA         NA  3.68298600 -0.97824547  7.368709
## [3,]  4.69742764 -2.079522111  4.1580797  0.22405412  3.71816214        NA
## [4,] -0.54819149  0.005691694  2.2030451  9.05330712  5.34991185  4.693064
## [5,] -1.97752145  3.456379937  3.3544335          NA          NA  7.038311
## [6,]          NA  0.873191385  3.4021159  4.71229082  6.00170883  4.058863
## [7,]          NA           NA         NA  7.65432583  6.23428976 -0.472939
## [8,] -1.16919791  0.968248298  7.9225385 -0.01632286  4.90089152        NA
## [9,] -2.70881936  2.271489941  2.3428489  5.98246089 -2.39769458  3.511567
##[10,] -2.85414717  6.795526313  3.5041962          NA          NA  4.279319
##[11,]          NA  1.734304664  6.5051516  6.05123657  4.38410223 10.511702
##[12,]          NA           NA         NA  3.81753414  6.95357984  3.677565
##[13,]  4.32954442  3.892262347  6.4357893  5.89888214  5.82129947        NA
##[14,]  3.12276506  1.659080313  1.2675960  8.00655285  8.07401970  2.217951
##[15,] -0.09097189 -2.598706009  9.0074482          NA          NA  4.936373
##[16,]          NA  0.436648047  3.2001026  7.05267591  4.37062049  5.779332
##[17,]          NA           NA         NA  0.43469789  6.13450332  2.494046
##[18,] -1.15165448  2.141463298 -1.0527081  1.83518668  2.16377351        NA
##[19,]  3.65395150  5.900596033  3.0629508  8.55765313  7.57076903  5.913475
##[20,] -2.04677774  8.879236921  6.7497437          NA          NA  8.012088
##[21,]          NA  6.642743177  0.8542734 -2.15666846 12.25032006  1.048360
##[22,]          NA           NA         NA -0.09211236  0.04685331  4.950737
##[23,]  1.64361648 -3.269582187  0.1843839  3.39765695  3.60803827        NA
##[24,] -1.21558311  0.833660408 -0.1575398  6.59733821  7.47613959  4.383573
##[25,] -0.72316607  2.267621669  1.6885214          NA          NA  6.681876
##[26,]          NA  4.535039012  3.9935375  5.87256242  3.23155688  7.476686
##[27,]          NA           NA         NA  6.87701613  2.00965777  6.803505
##[28,]  2.25694721  4.052928288  3.6359413  9.01316449  5.43342711        NA
##[29,]  1.97291303 -2.185823049  6.7100251  4.16805020  4.95707776  5.631874
##[30,] -1.34460946  4.548929137  9.1127221          NA          NA  4.758970
##[31,]          NA  0.660328351  6.9035280 -1.25971208  5.10365320 -1.929447
##[32,]          NA           NA         NA  4.29798278  5.57069095  5.721177
##[33,]  5.48818201  2.223653532 -2.1801912  2.28444983  5.52417919        NA
##[34,] -2.41191086  3.284500295  1.1954799  1.07797125  1.83494887  7.606197
##[35,]  0.46284522  2.074024948  1.9438606          NA          NA  4.334165

我得到&#34;模糊&#34;每次。 &#39;最顶层&#39;形式设计师的财产是假的。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

嗯,这是随机的。解决方案是将me.hide添加到me.load事件的顶部。

最终工作代码(整理了其他一些内容):

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    Me.Hide()

    'exe [1] [2] / [3] [4]
    ' 1: ScreenNumber
    ' 2: ImgFile
    ' 3: Screen Width
    ' 4: Screen Height

    If Not File.Exists(clArgs(2)) Then
        Debug.WriteLine("File doesn't exist. Closing..")
        Application.Exit()
    End If

    _selectedScreenNo = clArgs(1)

    _screenWidth = Screen.AllScreens(_selectedScreenNo).Bounds.Width
    _screenHeight = Screen.AllScreens(_selectedScreenNo).Bounds.Height
    Me.Location = Screen.AllScreens(_selectedScreenNo).Bounds.Location + New Point(0, 0)
    If clArgs.Count > 3 Then
        If clArgs.Count < 5 Then
            Debug.WriteLine("Not enough args. Closing.")
            Application.Exit()
        Else
            _screenWidth = clArgs(3)
            _screenHeight = clArgs(4)
        End If
    End If
    Me.Size = New Size(_screenWidth, _screenHeight)

    Dim fs As FileStream
    Dim FreedImage As Image
    fs = New FileStream(clArgs(2), FileMode.Open)
    FreedImage = Image.FromStream(fs)
    fs.Close()

    Me.BackgroundImage = FreedImage
    Me.BackgroundImageLayout = ImageLayout.Stretch

End Sub