| |
VB.NET - FortgeschritteneRe: Ist das dein code ? | | | Autor: spike24 | Datum: 03.12.07 09:09 |
| cooles teil 0 | |
dll? | | | Autor: Sabayon | Datum: 01.12.07 16:05 |
| Ich habe mal eine Frage is vielleicht doof aber hier kann man mir vielleicht helfen habe folgende DLL kann mir jemand sagen wie ich die benutzen kann?
Mit dieser DLL soll man eine MessageBox im Glass - Style nutzen können
Option Explicit On
Imports System
Imports System.Text
Imports System.Drawing
Imports System.Windows.Forms
Imports System.ComponentModel
Imports System.Drawing.Drawing2D
Imports System.Collections.Generic
Public Class AKLOIT
Inherits Form
''' <summary>
''' Declare All Message Buttons
''' </summary>
''' <remarks></remarks>
Private WithEvents CmdOk As Button
Private WithEvents CmdYes As Button
Private WithEvents CmdNo As Button
Private WithEvents CmdCancel As Button
Private WithEvents CmdAbort As Button
Private WithEvents CmdRetry As Button
Private WithEvents CmdIgnore As Button
''' <summary>
''' Declare All Message Variables
''' </summary>
''' <remarks></remarks>
Private WithEvents Frm As Form
Private WithEvents LblHeader As Label
Private WithEvents PicBox As PictureBox
Private WithEvents LblBody As Label
Private RetValue As DialogResult
Private MLocation As Point
Private BSize As Size = Nothing
Private BFont As New Font("Tahoma", 9, FontStyle.Bold)
Private _HeaderTitle As String = ""
Private _BodyMessage As String = ""
Private _MessageIcon As MessageBoxIcon
Private _MessageButton As MessageBoxButtons
''' <summary>
''' Set Constructor For MessageBox
''' </summary>
''' <remarks></remarks>
Public Sub New()
Frm = New Form()
BSize = New Size(430, 150)
With Frm
.FormBorderStyle = Windows.Forms.FormBorderStyle.None
.Size = BSize
.StartPosition = FormStartPosition.CenterScreen
.ShowIcon = False
.TopMost = True
.Text = ""
.Font = BFont
.Opacity = 0.85
.ShowInTaskbar = False
Call AddHeaderLabel()
.Controls.Add(LblHeader)
Call AddPicture()
.Controls.Add(PicBox)
Call AddBodyLabel()
.Controls.Add(LblBody)
End With
End Sub
Public Sub New(ByRef StartPosition As _
System.Windows.Forms.FormStartPosition)
Frm = New Form()
BSize = New Size(430, 150)
With Frm
.FormBorderStyle = Windows.Forms.FormBorderStyle.None
.Size = BSize
.StartPosition = StartPosition
.ShowIcon = False
.TopMost = True
.Text = ""
.Font = BFont
.Opacity = 0.85
.ShowInTaskbar = False
Call AddHeaderLabel()
.Controls.Add(LblHeader)
Call AddPicture()
.Controls.Add(PicBox)
Call AddBodyLabel()
.Controls.Add(LblBody)
End With
End Sub
''' <summary>
''' Declare All Properties And Methods
''' </summary>
''' <remarks></remarks>
Private Sub AddHeaderLabel()
LblHeader = New Label()
With LblHeader
.Text = ""
.Width = 430
.Height = 23
.Dock = DockStyle.Top
.Font = BFont
.Visible = True
End With
End Sub
... | |
Re: dll? | | | Autor: Sabayon | Datum: 01.12.07 16:06 |
| ...
Private Sub AddBodyLabel()
LblBody = New Label()
MLocation = New Point(49, 31)
With LblBody
.Text = ""
.Width = 310
.Height = 87
.AutoSize = False
.Location = MLocation
.BorderStyle = BorderStyle.None
.BackColor = Color.Transparent
.Font = BFont
.Visible = True
End With
End Sub
Private Sub AddPicture()
PicBox = New PictureBox()
MLocation = New Point(7, 31)
With PicBox
.Location = MLocation
.BorderStyle = BorderStyle.None
.BackColor = Color.Transparent
.Width = 35
.Height = 35
.Visible = True
End With
End Sub
Public Function ShowSAMAK_MESSAGE(ByVal MsgMessage As String, ByVal _
MsgButton As MessageBoxButtons, _
Optional ByVal MsgICon As MessageBoxIcon = _
MessageBoxIcon.None, _
Optional ByVal MsgHeader As String = "") As _
DialogResult
_HeaderTitle = MsgHeader.ToString()
_BodyMessage = MsgMessage.ToString()
_MessageIcon = MsgICon
_MessageButton = MsgButton
LblBody.Text = MsgMessage.ToString()
If MessageBoxIcon.Asterisk = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Asterisk.ToBitmap()
End If
If MessageBoxIcon.Error = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Error.ToBitmap()
End If
If MessageBoxIcon.Exclamation = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Exclamation.ToBitmap()
End If
If MessageBoxIcon.Hand = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Hand.ToBitmap()
End If
If MessageBoxIcon.Information = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Information.ToBitmap()
End If
If MessageBoxIcon.Question = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Question.ToBitmap()
End If
If MessageBoxIcon.Warning = _MessageIcon Then
PicBox.Image = System.Drawing.SystemIcons.Warning.ToBitmap()
End If
Call ShowButton(_MessageButton)
Frm.ShowDialog()
Return RetValue
End Function
.... | |
Re: dll? | | | Autor: Sabayon | Datum: 01.12.07 16:06 |
| ...
Private Sub ShowButton(ByVal BtnType As MessageBoxButtons)
BSize = New Size(58, 24)
If BtnType = MessageBoxButtons.AbortRetryIgnore Then
BSize = New Size(58, 24)
CmdAbort = New Button
Dim BLocation As New Point(248, 120)
Call CommanSet(CmdAbort, "&Abort", BSize, BLocation)
BLocation = Nothing
CmdRetry = New Button
BLocation = New Point(308, 120)
Call CommanSet(CmdRetry, "&Retry", BSize, BLocation)
BLocation = Nothing
CmdIgnore = New Button
BLocation = New Point(368, 120)
Call CommanSet(CmdIgnore, "&Ignore", BSize, BLocation)
BLocation = Nothing
End If
If BtnType = MessageBoxButtons.OK Then
BSize = New Size(58, 24)
CmdOk = New Button
Dim BLocation As New Point(368, 120)
Call CommanSet(CmdOk, "&Ok", BSize, BLocation)
BLocation = Nothing
Exit Sub
End If
If BtnType = MessageBoxButtons.OKCancel Then
BSize = New Size(58, 24)
CmdYes = New Button
Dim BLocation As New Point(308, 120)
Call CommanSet(CmdYes, "&Ok", BSize, BLocation)
BLocation = Nothing
CmdNo = New Button
BLocation = New Point(368, 120)
Call CommanSet(CmdNo, "&Cancel", BSize, BLocation)
BLocation = Nothing
Exit Sub
End If
If BtnType = MessageBoxButtons.RetryCancel Then
BSize = New Size(58, 24)
CmdYes = New Button
Dim BLocation As New Point(308, 120)
Call CommanSet(CmdYes, "&Retry", BSize, BLocation)
BLocation = Nothing
CmdNo = New Button
BLocation = New Point(368, 120)
Call CommanSet(CmdNo, "&Cancel", BSize, BLocation)
BLocation = Nothing
Exit Sub
End If
If BtnType = MessageBoxButtons.YesNo Then
BSize = New Size(58, 24)
CmdYes = New Button
Dim BLocation As New Point(308, 120)
Call CommanSet(CmdYes, "&Yes", BSize, BLocation)
BLocation = Nothing
CmdNo = New Button
BLocation = New Point(368, 120)
Call CommanSet(CmdNo, "&No", BSize, BLocation)
BLocation = Nothing
Exit Sub
End If
If BtnType = MessageBoxButtons.YesNoCancel Then
BSize = New Size(58, 24)
CmdYes = New Button
Dim BLocation As New Point(248, 120)
Call CommanSet(CmdYes, "&Yes", BSize, BLocation)
BLocation = Nothing
CmdNo = New Button
BLocation = New Point(308, 120)
Call CommanSet(CmdNo, "&No", BSize, BLocation)
BLocation = Nothing
CmdCancel = New Button
BLocation = New Point(368, 120)
Call CommanSet(CmdCancel, "&Cancel", BSize, BLocation)
BLocation = Nothing
End If
End Sub
.... | |
Re: dll? | | | Autor: Sabayon | Datum: 01.12.07 16:07 |
| ...
Private Sub CommanSet(ByVal Btn As Button, ByVal Txt As String, ByVal Sz As _
Size, ByVal Lc As Point)
With Btn
.Size = Sz
.Text = Txt
.BackColor = Color.Transparent
.FlatAppearance.BorderSize = 0
.FlatStyle = FlatStyle.Standard
.Location = Lc
.Anchor = AnchorStyles.Bottom Or AnchorStyles.Left Or _
AnchorStyles.Right
.TextAlign = ContentAlignment.MiddleCenter
.Font = BFont
.Visible = True
End With
Frm.Controls.Add(Btn)
End Sub
Private Sub LblHeader_MouseDown(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles LblHeader.MouseDown
MLocation = e.Location
End Sub
Private Sub LblHeader_MouseMove(ByVal sender As Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles LblHeader.MouseMove
If String.Compare(Control.MouseButtons.ToString(), "Left") = 0 Then
Dim MSize As New Size(MLocation)
MSize.Width = e.X - MLocation.X
MSize.Height = e.Y - MLocation.Y
Frm.Location = Point.Add(Frm.Location, MSize)
End If
End Sub
Private Sub LblHeader_Paint(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles LblHeader.Paint
Dim MGraphics As Graphics = e.Graphics
Dim MPen As New Pen(Color.FromArgb(96, 155, 173), 1)
Dim Area As New Rectangle(0, 0, LblHeader.Width - 1, LblHeader.Height - _
1)
Dim LGradient As New LinearGradientBrush(Area, Color.FromArgb(166, 197, _
227), Color.FromArgb(245, 251, 251), _
LinearGradientMode.BackwardDiagonal)
MGraphics.FillRectangle(LGradient, Area)
MGraphics.DrawRectangle(MPen, Area)
Dim DrawFont As New Font("Tahoma", 10, FontStyle.Bold)
Dim DrawBrush As New SolidBrush(Color.Black)
Dim DrawPoint As New PointF(2.0F, 3.0F)
Dim DrawGradientBrush As New LinearGradientBrush(e.Graphics.ClipBounds, _
Color.White, _
Color.FromArgb(122, 158, 226), _
LinearGradientMode.ForwardDiagonal)
e.Graphics.DrawString(_HeaderTitle.ToString(), DrawFont, DrawBrush, _
DrawPoint)
End Sub
Private Sub FrmMessageBox_Paint(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.PaintEventArgs) Handles Frm.Paint
Dim MGraphics As Graphics = e.Graphics
Dim MPen As New Pen(Color.FromArgb(96, 155, 173), 1)
Dim Area As New Rectangle(0, 0, Frm.Width - 1, Frm.Height - 1)
Dim LGradient As New LinearGradientBrush(Area, Color.FromArgb(166, 197, _
227), Color.FromArgb(245, 251, 251), _
LinearGradientMode.BackwardDiagonal)
MGraphics.FillRectangle(LGradient, Area)
MGraphics.DrawRectangle(MPen, Area)
End Sub
Private Sub CmdOk_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdOk.Click
RetValue = Windows.Forms.DialogResult.OK
Frm.Dispose()
End Sub
Private Sub CmdYes_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdYes.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Yes
End Sub
Private Sub CmdNo_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdNo.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.No
End Sub
Private Sub CmdRetry_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdRetry.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Retry
End Sub
Private Sub CmdCancel_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdCancel.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Cancel
End Sub
Private Sub CmdAbort_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdAbort.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Abort
End Sub
Private Sub CmdIgnore_Click(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles CmdIgnore.Click
Frm.Dispose()
RetValue = Windows.Forms.DialogResult.Ignore
End Sub
End Class | |
Re: dll? | | | Autor: cookstdu | Datum: 01.12.07 17:13 |
| Hallo
ganz einfach
Verweis auf deine DLL hinzufügen, dann
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim ak As New deineDLL.AKLOIT
ak.ShowSAMAK_MESSAGE("JUHU", MessageBoxButtons.OK, MessageBoxIcon.Hand, _
"TEST")
End Sub cu
Wenn alle Stricke rei?en, dann h?ng ich mich auf. ~ Karl Kraus | |
Ist das dein code ? | | | Autor: mikeb69 | Datum: 01.12.07 19:28 |
| hallo Sabayon,
hast du den code geschrieben ?
woher stammt er ?
ist er frei verwendbar ?
gruss
mikeb69 | |
Re: Ist das dein code ? | | | Autor: Jan Bender | Datum: 01.12.07 19:49 |
| Wollte ich dich auch fragen, ob ich den verwenden darf. Hab dir aber eine Email an die Email in deinem Profil geschrieben. | |
Re: Ist das dein code ? | | | Autor: Sabayon | Datum: 02.12.07 01:44 |
| Es tut mir leid euch enttäuschen zu müssen.
Aber wenn das mein Code wäre würde ich doch wissen wie man Ihn benutzt oder?
ich habe ihn als Snipped auf einer seite zum freien download gefunden per google
wenn gewünscht kann ich versuchen die seite nochmal zu finden^^
aber ihr könnt ihn auch verwenden | |
Re: Ist das dein code ? | | | Autor: mikeb69 | Datum: 02.12.07 09:09 |
| hallo sabayon,
wäre nett wenn du dich auf die suche machen könntest.
danke
mikeb69 | |
aber nicht echt aero^^ | | | Autor: Sabayon | Datum: 03.12.07 14:57 |
| Sieht zwar cool aus und hat seinen Charme aber ich finde nach Microsoft Windows Vista
Aero sieht das ganze nicht aus | |
Re: aber nicht echt aero^^ | | | Autor: Jan Bender | Datum: 03.12.07 16:12 |
| [Off Topic]...was aber auch niemand behauptet hat.
"Glass" ist nicht Aero, sondern nur etwas durchsichtig.
[/Off Topic] | |
Re: dll? | | | Autor: Sabayon | Datum: 04.12.07 11:25 |
| Ich freu mich trotzdem das es hier so viele Leute gibt die einem gerne helfen | |
| Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
|
|
vb@rchiv CD Vol.6 vb@rchiv Vol.6
Geballtes Wissen aus mehr als 8 Jahren vb@rchiv!
Online-Update-Funktion Entwickler-Vollversionen u.v.m.Jetzt zugreifen Tipp des Monats Neu! sevEingabe 3.0
Einfach stark!
Ein einziges Eingabe-Control für alle benötigten Eingabetypen und -formate, inkl. Kalender-, Taschenrechner und Floskelfunktion, mehrspaltige ComboBox mit DB-Anbindung, ImageComboBox u.v.m. Weitere Infos
|