473,324 Members | 1,646 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,324 software developers and data experts.

comboBox1_DrawItem......with icom

in vc.net...
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);

g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}

convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist

Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)

g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e .Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub

does ne 1 know how to fix problem?
regards,
supra
Nov 22 '05 #1
3 2048
i soloved problem by using pointF
regards

Supra wrote:
in vc.net...
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);

g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}

convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist

Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)

g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e .Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub

does ne 1 know how to fix problem?
regards,
supra


Nov 22 '05 #2
i got error problem........the error is:
Additional information: Specified argument was out of the range of valid
values.
g.DrawString(ComboBox2.Items(e.Index).ToString(), e.Font, New
SolidBrush(e.ForeColor), New PointF(28, (bmp.Height - e.Font.Height)/2))

i got icon working on dropdownlist but no text dispalying . does ne 1
knows how to get text displayed?
regards,
supra

Supra wrote:
i soloved problem by using pointF
regards

Supra wrote:
in vc.net...
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);

g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}

convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist

Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)

g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e .Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub

does ne 1 know how to fix problem?
regards,
supra


Nov 22 '05 #3
I solved again
thank alot
Supra wrote:
i got error problem........the error is:
Additional information: Specified argument was out of the range of
valid values.
g.DrawString(ComboBox2.Items(e.Index).ToString(), e.Font, New
SolidBrush(e.ForeColor), New PointF(28, (bmp.Height - e.Font.Height)/2))

i got icon working on dropdownlist but no text dispalying . does ne 1
knows how to get text displayed?
regards,
supra

Supra wrote:
i soloved problem by using pointF
regards

Supra wrote:
in vc.net...
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
Bitmap bmp = new
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics);
Graphics g = Graphics.FromImage(bmp);

g.FillRectangle(new SolidBrush(e.BackColor), new
Rectangle(0,0,bmp.Width,bmp.Height));
g.DrawString(comboBox1.Items[e.Index].ToString(),e.Font ,new
SolidBrush(e.ForeColor), new Point(28,(bmp.Height-e.Font.Height)/2));
g.DrawImage(imageList1.Images[e.Index], new Rectangle(new
Point(6,0),new Size(16,16)));
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y);
}

convert to vb.net ................and i still got error problem for
drawstring and drawimage. i set drawmode to onwerdrawfixed and
dropdownstyle to dropdownlist

Private Sub comboBox1_DrawItem(ByVal sender As Object, ByVal e As
DrawItemEventArgs) Handles ComboBox1.DrawItem
Dim bmp As Bitmap = New
Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics)
Dim g As Graphics = Graphics.FromImage(bmp)

g.FillRectangle(New SolidBrush(e.BackColor), New
Rectangle(0,0,bmp.Width,bmp.Height))
g.DrawString(comboBox1.Items(e.Index).ToString(),e .Font ,New
SolidBrush(e.ForeColor), New Point(28,(bmp.Height-e.Font.Height)/2))
g.DrawImage(imageList1.Images(e.Index), New Rectangle(New
Point(6,0),New Size(16,16)))
e.Graphics.DrawImage(bmp,e.Bounds.X,e.Bounds.Y)
End Sub

does ne 1 know how to fix problem?
regards,
supra


Nov 22 '05 #4

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

Similar topics

0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
0
by: FreeStyle | last post by:
Hi everybody, I'm using phpMyAdmin 2.2.6 with EasyPHP v.1.6.0.0 I wrote a php script which uses a username (added in the mysql base with phpMyAdmin). This user has no privileges. But in the...
0
by: Madhusudan Singh | last post by:
Hi I wonder if there is a clean way of using https with header() in PHP ? I am using statements like header("Location: script.php?arg1=argvalue") to transfer control in my application. Thanks,...
3
by: Marcus | last post by:
I'm really confused with something I never had any problems with before... I have a form with a textbox called password. On the second page that $password is posted to, if I test isset($password)...
1
by: lnxsimon | last post by:
Hi, i have a problem with a form. In my page there is the following code: -------------------------------------------------------------------------------- <script language="javascript"> ...
0
by: Andrew Crowe | last post by:
Hi guys, I've come across a rather strange, and very anoying problem. On /some/ PHP sites that we're developing on 2 different servers, files that are in the root of the website are unable to...
3
by: Curious Expatriate | last post by:
Hi- I'm completely stumped. I'm trying to write some code that will parse a file and rewrite it with all URLs replaced by something else. For example: if the file looks like this: <b>click...
0
by: eric | last post by:
Greetings! I've installed Apache 2.0.xx and PHP 4.3.2. I want to use Ming as a module to PHP. The instructions that came with Ming say to: as a php module (unix) download php_ming.so.gz...
3
by: Supra | last post by:
in vc.net... private void comboBox1_DrawItem(object sender, DrawItemEventArgs e) { Bitmap bmp = new Bitmap(e.Bounds.Width,e.Bounds.Height,e.Graphics); Graphics g = Graphics.FromImage(bmp); ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.