TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Goran Bibic
482
2.9k
195.4k
Create rounded button c#
Apr 25 2018 2:17 PM
I need to create rounded button
My code is for classic button and workign fine
private
void
mp_kasa_pos_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'bssDataSet.mp_kasa_roba' table. You can move, or remove it, as needed.
this
.mp_kasa_robaTableAdapter.Fill(
this
.bssDataSet.mp_kasa_roba);
SqlConnection con =
new
SqlConnection(
"Data Source=.\\SQLEXPRESS;Initial Catalog=bss;Integrated Security=True"
);
SqlCommand cmd =
new
SqlCommand(
"SELECT ime+'-'+cijena_sa_porezom, data FROM roba_usluge"
, con);
var da =
new
SqlDataAdapter(cmd);
var ItemTable =
new
DataTable();
da.Fill(ItemTable);
con.Open();
Int32 count = ItemTable.Rows.Count;
con.Close();
int
top = 10;
int
left = 10;
for
(
int
i = 1; i <= count; i++)
{
Button button =
new
Button();
button.Size =
new
Size(128, 128);
button.BackColor = Color.Transparent;
//button.FlatStyle = FlatStyle.Flat;
button.FlatAppearance.BorderSize = 0;
button.Font =
new
System.Drawing.Font(
"Trebuchet MS"
, 10);
button.TextAlign = ContentAlignment.TopCenter;
button.BackgroundImageLayout = ImageLayout.Zoom;
button.Left = left;
button.Top = top;
button.Text = ItemTable.Rows[i - 1][0].ToString();
if
(ItemTable.Rows[i - 1][1] != null)
{
try
{
byte[] _byte = (byte[])ItemTable.Rows[i - 1][1];
MemoryStream ms =
new
MemoryStream(_byte);
button.BackgroundImage = System.Drawing.Image.FromStream(ms);
//bilo image
}
catch
{ }
}
button.Click +=
new
EventHandler(
this
.btn_Click);
this
.Controls.Add(button);
if
(i % 5 == 0)
{
left = 10;
top += button.Height + 2;
}
else
{
left += button.Width + 2;
}
}
}
Reply
Answers (
3
)
specific cast is not valid linq when compare two datatable
WPF app for pattern generated by intersecting circles