473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how can I reference this bitmap?????????

Guys the below code is not working ( i know i am trying to reference a
function!) .

Im a beginner so does anyone know how i could reference the bitmap?

Private Sub MarkVORToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MarkVORToolStripMenuItem.Click
If ContextMenuStrip1.SourceControl.BackgroundImage Is
DrawCross() Then
msgbox("test")
End Sub

Friend Function DrawCross() As Bitmap
Dim sampleBitmap As New Bitmap(32, 32)
Dim g As Graphics = Graphics.FromImage(sampleBitmap)
Dim p As New Pen(ProfessionalColors.ButtonPressedBorder)
p.Color = Color.Red
Try
p.Width = 2
g.DrawLine(p, -35, 65, 80, -45)
g.DrawLine(p, 200, 200, 0, 0)
Finally
p.Dispose()
End Try
Return sampleBitmap
End Function

Dec 13 '06 #1
3 1542
"Marc" <ma*********@hotmail.comschrieb:
Guys the below code is not working ( i know i am trying to reference a
function!) .

Im a beginner so does anyone know how i could reference the bitmap?
\\\
Private m_Cross As Bitmap

Public Sub New()
m_Cross = DrawCross()
End Sub
Private Sub MarkVORToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MarkVORToolStripMenuItem.Click
If ContextMenuStrip1.SourceControl.BackgroundImage Is
DrawCross() Then
Replace the line above with this:

\\\
If ContextMenuStrip1.SourceControl.BackgroundImage Is m_Cross Then
...
End If
///
End Sub

Friend Function DrawCross() As Bitmap
Dim sampleBitmap As New Bitmap(32, 32)
[...]
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Dec 14 '06 #2
Thanks Herfried....

your a star!
Herfried K. Wagner [MVP] wrote:
"Marc" <ma*********@hotmail.comschrieb:
Guys the below code is not working ( i know i am trying to reference a
function!) .

Im a beginner so does anyone know how i could reference the bitmap?

\\\
Private m_Cross As Bitmap

Public Sub New()
m_Cross = DrawCross()
End Sub
Private Sub MarkVORToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
MarkVORToolStripMenuItem.Click
If ContextMenuStrip1.SourceControl.BackgroundImage Is
DrawCross() Then

Replace the line above with this:

\\\
If ContextMenuStrip1.SourceControl.BackgroundImage Is m_Cross Then
...
End If
///
End Sub

Friend Function DrawCross() As Bitmap
Dim sampleBitmap As New Bitmap(32, 32)
[...]

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Dec 14 '06 #3
"Marc" <ma*********@hotmail.comschrieb:
Thanks Herfried....

your a star!
You are welcome!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Dec 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kent | last post by:
Hi! I am working with an obscure graphics library in school as a university C++ programming project. The graphics library has a class kalled Bitmap wich you use to draw graphics (you can "stamp...
2
by: abhi.menon | last post by:
I have a "Plot" button the code associated with which (when Clicked) is as follows private: System::Void showPic_Click(System::Object * sender, System::EventArgs * e) { /* code to use Matlab...
6
by: Marc | last post by:
The below snippet does not work...anyone know how to reference the procedure 'DrawCross()'? Private Sub MarkVORToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As...
3
by: Sarah | last post by:
Hi - Please be gentle. I am quite new to visual basic, but I have been going through tutorials and reading up. I found a code snippet on the internet that I wanted to see if I could re-purpose...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.