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 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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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.
...
|
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...
|
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...
|
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,...
|
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)...
|
by: lnxsimon |
last post by:
Hi,
i have a problem with a form. In my page there is the following code:
--------------------------------------------------------------------------------
<script language="javascript"> ...
|
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...
|
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...
|
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...
|
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);
...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
| |