OnPaint when using Offscreen bitmap
I am using an offscreen bitmap and I have scrolling.
For now I DrawImage the entire offscreen bitmap -- but that is slow.
Could anyone please tell me how to only DrawImage the portion I need so it
will go faster.
Thank you!
For now I do:
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.TranslateTransform(
AutoScrollPosition.X, AutoScrollPosition.Y);
e.Graphics.DrawImage(offScreenBmp, 0, 0);
System.Drawing.Size s = new System.Drawing.Size();
s.Width = 0;
s.Height = 2100;
AutoScrollMinSize = s;
} Tag: Selecting Listview Item by Text Tag: 61861
Problems with MessageBox.Show
I'm experiencing a problem where I have a non-modal toolwindow that contains
a control derived from System.Windows.Forms.ComboBox displayed in an MDI
application. Whenever a .NET message box is displayed in the application the
derived combo boxes on the toolwindow appear to lose their base control,
i.e. base.WndProc(ref m) in the derived control's WndProc results in a
NullReferenceException. Admittedly this could be a problem with the derived
controls, however after looking at how System.Windows.Forms.MessageBox works
it seems like there are some "oddities". Also, if I call the Win32
MessageBox function directly via p/invoke, specifying the correct owner
window, then everything works fine.
Here is the section of System.Windows.Forms.MessageBox (ShowCore) that I've
been looking at:
if ((owner != null) && ((options & 2228224) != 0))
throw new ArgumentException(SR.GetString("CantShowMBServiceWithOwner"),
"style");
IntSecurity.SafeSubWindows.Demand();
num1 = (((buttons | icon) | defaultButton) | options);
ptr1 = IntPtr.Zero;
if ((options & 2228224) == 0)
{
if (owner == null)
ptr1 = UnsafeNativeMethods.GetActiveWindow();
else
ptr1 = owner.Handle;
}
Application.BeginModalMessageLoop();
result1 = MessageBox.Win32ToDialogResult(SafeNativeMethods.MessageBox(new
HandleRef(owner, ptr1), text, caption, num1));
Application.EndModalMessageLoop();
return result1;
The value of 2228224 corresponds to MessageBoxOptions.DefaultDesktopOnly |
MessageBoxOptions.ServiceNotification. The interesting thing here is that
the owner parameter is always ignored since owner must be null when options
contains the above flags. If owner is not null, the handle is never
retrieved because options cannot also contain the above flags and therefore
ptr1 remains as IntPtr.Zero. The other interesting thing is the
BeginModalMessageLoop/EndModalMessageLoop block. It appears as though this
disables all windows in the current thread, although I haven't looked at
this too deeply, and this further implies that the owner parameter plays no
part in establishing modality. Does anyone have any thoughts on this,
particularly with reference to the fact that the
BeginModalMessageLoop/EndModalMessageLoop block appears to be causing severe
problems for my non-modal windows? A single call to the Win32 MessageBox
function with a correctly specified owner window does not exhibit the same
problems.
TIA.
--
Kevin Westhead Tag: Selecting Listview Item by Text Tag: 61859
PropertyGrid customization
Hi,
I'm in the process of customizing the PropertyGrid for an
application. I've written several TypeConverters and a
few editors to display and process data within the grid.
What I haven't been able to do yet is have the editor
control receive the mouse input from another window.
For example, I have a CAD app and I want modify a line
entity. I select the entity and its properties are
displayed in the PropertyGrid. I select the beginning
coordinate field in the PropertyGridwant to modify the
coordinate of the beginning point by selecting the
location in the graphics window. Is this possible, or do
I just need to create my own custom version of the
PropertyGrid??
What I would ideally like to do is embed an existing
custom control inside the PropertyGrid.
TIA,
Peter Tag: Selecting Listview Item by Text Tag: 61851
Preventing "ding!" on Esc or Enter in a textbox
Anybody know how to prevent the ding sound from happening when the escape or
enter key is entered into a textbox? I need to catch the enter and escape
keys for processing.
I've the following event handler for on the Keydown event of the text box,
but I'm still getting the ding sound.
private void EditBoxKeyDown(object sender, System.Windows.Forms.KeyEventArgs
e)
{
if ( e.KeyCode == Keys.Enter )
{
/* do some processing */
e.Handled = true;
}
if ( e.KeyCode == Keys.Escape )
{
/* do some processing */
e.Handled = true;
}
} Tag: Selecting Listview Item by Text Tag: 61848
Form Start Position question
When I set the StartPosition on my main form to CenterScreen, the form never
starts at center screen, but offset toward the lower right corner. On my
modal login form, however, the property seems to work just fine.
Am I overlooking something??
Thanks! Tag: Selecting Listview Item by Text Tag: 61846
Form Scrolling
I have scrolling in my app.
When I click the arrows of the scroll bar or click inside the scroll bar the
app scrolls -- but when I drag the scroll box (that part in the middle) the
app does not scroll until after I release the mouse button. I'd like it to
scroll as I drag that scroll box. I figure I could just call this.refresh
but I do not see any events for the Form that fire while dragging that box?
Thank you. Tag: Selecting Listview Item by Text Tag: 61843
Call another form
Hi
I created two forms in the same proyect and I want to call
one form from another one but I couldn't find the Show
method. I'm working with C#.
In Visual Basic 6 you can tell the proyect which form use
first.
Regards Tag: Selecting Listview Item by Text Tag: 61838
Custom Authentication
I have a project where I have to build an internet cafe type program. I am
having a problem figuring out how to authenticate at user stations .
What I want to do is client machine to be locked and needs a temporary
password to get in. I am not sure how to lock the workstation. I am not just
looking for a solution, but suggestions. I have looked in google but I am
not sure what I am looking for. Any ideas?
John Tag: Selecting Listview Item by Text Tag: 61837
NumericUpDown Control bug
Hi,
I am using a control derived from NumericUpDown control
and when I click on the arrow and keep clicking on it for
long it crashes giving following error :
System.NullReferenceException: Object reference not set to
an instance of an object.
at System.Windows.Forms.UpDownButtons.TimerHandler
(Object source, EventArgs args)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.DebuggableCallback(IntPtr
hWnd, Int32 msg, IntPtr idEvent, IntPtr dwTime)
Can anyone tell me how to fix this? I want to just handle
this exception so that it stops cpmplainng but don't know
what event to handle.
Thanks in advance for the help.
Gudia Tag: Selecting Listview Item by Text Tag: 61836
Custom painting in TextBox
Hello
I have a new class which inherits from TextBox and
implements a numeric textbox which have to allow the user
to input signed numbers. The control of key input is OK.
The problem is how to implement the display of the sign
character. I am planning to enabled this feature by
allowing the pressing of plus and minus keys (+ and -).
When the user hits the minus key, the negative sign
appears at the left side of the number; when he hits the
plus key, no sign is shown in the textbox.
This means that changing the left margin of the textbox is
not enough to make this feature work because the textbox's
default alignment is at the right side, and, in addition,
the textbox must allows the programmer to change the
text's alignment.
I do not want to include the negative sign character in
the text because of the lot of code I will have to write
in order to control user key hitting. I am thinking about
just painting the negative sign character at the left side
of the text, without including it in the text, by handling
some paint event.
Does somebody knows some guidelines on how can I do this?
Celio C Jr Tag: Selecting Listview Item by Text Tag: 61835
System.Windows.Forms.MdiClient+ControlCollection not serializable.
Scenario:
---------
I have an Explorer style application.
The app hosts other win forms by making them MDI children, removing border /
control box / minimize / maximize, and setting the form's Dock property to
Fill.
I have recently upgraded my application in the following way:
-------------------------------------------------------------
The MDI child forms are now contained within separate dynmically loaded
assemblies. My host application creates a new application domain to load the
assemblies into. A new instance of the child form is created within the
context of the new application domain, then my host application communicates
with that object via Remoting (cross AppDomains).
Problem:
---------
I can no longer set the MDI Child form's MdiParent property to my host app
because my host app's ControlCollection is not serializable, and I get a
SerializationException thrown.
I either need to:
- Find a way to set my remote MDI child's "MdiParent" property, or
- Use the Win32 Api to create the child form as an MDI Child without adding
it to my host application's MdiChildren collection. I don't really know how
to do this, and am not sure it is even possible when using WinForms.
Any suggestions?
Trevor Germain, CET, MCP
i-Gen Solutions, Inc. Tag: Selecting Listview Item by Text Tag: 61830
OLE in Windows Form
How can insert an OLE object in a Windows Form?
If visual basic 6.0 you could use the OLE Control to a complish the same
task Tag: Selecting Listview Item by Text Tag: 61824
Serialiazing a form
Hi,
i want to persist a few properties of a form ...how do i do it ? any
leads is greatly appriciated
regards,
... Tag: Selecting Listview Item by Text Tag: 61778
Changing TextBox left margin
Hello,
How can I change the TextBox's left margin so I can create
an inherited class from TextBox and paint something on its
left side?
Thank you.
Celio C Jr Tag: Selecting Listview Item by Text Tag: 61768
How can I capture rows changing in datagrid (winforms) when arrow up/down is pressed?
I update a form with labels and text boxes when the user clicks on the
rowheader of my winforms datagrid. I notice that the user can move to
a new row using the arrow up/down keys. I currently update the form
using the click event of the datagrid. How can I update the form when
the user moves to a new row using the arrow keys? In other words, I
need to capture the arrow keys when the datagrid is active or when a
new row is selected. BTW, I am using C#, however, if a VB.Net
developer has a solution, please reply. I can always convert the
code. Tag: Selecting Listview Item by Text Tag: 61758
SqlDataAdapter.RowUpdated Event
Hi,
Strangely enough, I cannot get the RowUpdated and RowUpdating events of a SqlDataAdapter to fire. I have done the standard subscribing to the event, and connecting the event handlers. But nothing happens.
Any help would be greatly appeciated.
Thanks,
Mark
Within a procedure:
daPersonPhone.RowUpdated +=new SqlRowUpdatedEventHandler(OnRowUpdated);
daPersonPhone.RowUpdating +=new SqlRowUpdatingEventHandler(OnRowUpdating);
The event handlers:
private void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e)
{
if (e.StatementType == StatementType.Insert)
{
if (e.RecordsAffected == 1)
{
int newOrderID = (int)e.Row["OrderID"];
DataRow newRow = dsOriginal.Tables["Phone"].Rows.Find(dummyPhoneID);
newRow["OrderID"] = newOrderID;
}
}
}
private void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
{
if (e.StatementType == StatementType.Insert)
dummyPhoneID = (int)e.Row["PhoneID", DataRowVersion.Current];
}
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Selecting Listview Item by Text Tag: 61755
Web Services: How slow/fast they are
Subject: Windows distributed app
Data layer: SQL Server ( on separate machine )
Middle layer: WebServices on IIS ( on separate machine )
Questions:
1) How much Web Service are faster/slower compared to
other solutions for middle layer. Are there some (
benchmark or similar ) results which can at least
indicate me that figures.
2) How to configure Web Server ( machine resoureces and
Set up ) to get fastes possible Web Server - Web Services
response. The case could be system with up to 200 WinForm
Clients.
Thank you in advance
Gisa Tag: Selecting Listview Item by Text Tag: 61754
IDisposable, using(), RAII and structs [Discussion]
Last night I had several thought about RAII and want to discuss a bit.
Why doesn't CSharp support destructors in structs? Wouldn't that make RAII
possible like in C++? When the struct goes out of scope, the dtor could be
immediately be called (no GC needed).
For that, you don't have to declare the whole File class as a struct (which
would be not good for performance when File has a lot of data-members).
Instead creating a thin wrapper would be a good solution:
public struct MyFile
{
File f;
public MyFile(string p) { f=new File(p); }
~MyFile() { f.Close(); }
}
That would do it.
I have a second though which got through my mind. What about introducing an
interface which is recognized by the compiler and forces usage of the
using() statement.
public interface IDisposableForce : IDisposable{}
A second possibility could be declaring an attribute which marks
IDisposable-implementing-classes wheather using() should be mandatory or at
least suggested.
enum WarnLevel {NoWarn,WarnLvl1,WarnLvl2,WarnLvl3,WarnLvl4,GenerateError};
class UsingAttribute{UsingAttribute(WarnLevel w){}}
[Using(WarnLvl3)] // that means if warnlevel 3 or higher is set a warning
is issued when this class is used without using()-statement
public class MyFile : File
{
public class MyFile(string p) :base(p){}
}
What do you think?
--
cody
[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk Tag: Selecting Listview Item by Text Tag: 61739
Selecting Text
I have a basic app that draws some text: Graphics.DrawString(...).
I want to be able to mouse select that text and copy to clipboard. Does
anyone know of any sample info on doing that.
Thank you. Tag: Selecting Listview Item by Text Tag: 61733
Full dataset into an empty SQL table
Hi,
I managed to create a SQL server database and a table in it. The table is
empty and that brings me to my next chalenge:
How can I get the info in the table in the dataset to go in an empty SQL
table?
Is there a short way like the FILL method to get data into the dataset or do
I have to read each datarow in the table and write it one at the time to the
database?
rg,
Eric Tag: Selecting Listview Item by Text Tag: 61724
[urgent] Message Box is non-modal in VB!
Hi,
In some situation, the message box can not be shown in modal mode.
Please drop a DateTimePicker control on a Form (VB project), show a
message box in the ValueChanged event, as below snippet. Now run the form
and drop down the calendar, select a date to let the event fire, after the
message box shown, we can still activate the form background. This happens
whatever MsgBoxStyle is specified even as MsgBoxStyle.SystemModal.
Private Sub DateTimePicker1_ValueChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles DateTimePicker1.ValueChanged
MsgBox("DateTimePicker1_ValueChanged", MsgBoxStyle.ApplicationModal)
End Sub
The same scenario could be reproduced in a C# project, but I could pass it
if by specifying the Form as the owner of the message box, as below code.
private void dateTimePicker1_ValueChanged(object sender, System.EventArgs
e)
{
MessageBox.Show(this, "dateTimePicker1_ValueChanged");
}
Is something wrong in the message box method in VB?
-jason Tag: Selecting Listview Item by Text Tag: 61721
Button.TextAlign bug?
Hi,
I'm using C# and VS.net 2003. When adding a button to a
form using the designer, the default TextAlign value is
always set to MiddleCenter (which is fine). However, if I
change the font to be bold, the text is no longer center-
aligned, it is always a bit off to the right, more or
less depending on the string value. The TextAlign
property is still MiddleCenter though. Is this a known
bug?
Thanks,
Henrik Tag: Selecting Listview Item by Text Tag: 61711
A From won't close (c#)
Hello everyone,
I have main application form (child of System.Windows.Forms.Form) that
hosts quite a number of different visual components. Some time after
working with those components, the form refuses to be closed - I click
menu item that invokes Form.Close() method, I click 'close' icon on
the caption of the window (form) - nothing happens. No event comes to
Form_Closing(Object, CancelEventArgs) method either.
I'm at a loss how to even start debugging this situation and I would
appreciate any suggestions.
Thank you for your time,
Yuriy ZUbarev Tag: Selecting Listview Item by Text Tag: 61707
DataReader and ListBox
oh come on. I have to be missing something.
There HAS to be a better way of binding data to a winform listbox that
reading through all the records and adding each item to the items
collection.
Its .NET for crying out loud. Tag: Selecting Listview Item by Text Tag: 61706
How to force window to Maximize
Hi,
I would like to force my application to maximize when it is launched. I
have tried this by setting the WindowState in the designer at runtime, and
have also tried executing
WindowState = FormWindowState.Normal
The form does open maximized but it does not correctly maximize to the
Windows taskbar...the bottom of the form is lost under the taskbar. If I
use the form control menu to set the form to normal and then back to
maximized, it correctly fits into the available desktop area, only going up
to the top of the taskbar. Any ideas why???
Also I want to stop the user setting the window state to normal - I either
want it maximized or minimized, but never normal. If the user
double-clicks the Window title it does set the window state to normal. Is
there an easy way to prevent this from happening???
Many thanks. Tag: Selecting Listview Item by Text Tag: 61704
Check for illegal char in DataGridTextBoxColumn
Hi all, need some help in taking the right approach to
solve this problem.
I have a DataGrid bound to a DataTable. I need the user to
enter only numerical values and decimal. I did override
the ProcessCmdKey of DataGrid. I'm capturing Enter, Tab,
directinal and other keys. If the user enters an invalid
key, I need to prompt him. But, for this I'll need to map
all the other keys to be invalid in my code. Is there any
other slick way of doing this.
Code attached.
protected override bool ProcessCmdKey(ref Message msg,
Keys keyData)
{
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
int rowNum = dGInput.CurrentCell.RowNumber;
int colNum = dGInput.CurrentCell.ColumnNumber;
if ((colNum == 2) || (colNum == 5))
{
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
switch(keyData)
{
case Keys.D0:
case Keys.D1:
case Keys.D2:
case Keys.D3:
case Keys.D4:
case Keys.D5:
case Keys.D6:
case Keys.D7:
case Keys.D8:
case Keys.D9:
case Keys.NumPad0:
case Keys.NumPad1:
case Keys.NumPad2:
case Keys.NumPad3:
case Keys.NumPad4:
case Keys.NumPad5:
case Keys.NumPad6:
case Keys.NumPad7:
case Keys.NumPad8:
case Keys.NumPad9:
case Keys.Decimal:
case Keys.OemPeriod:
break;
case Keys.Back:
break;
case Keys.Down:
case Keys.Up:
case Keys.Left:
case Keys.Right:
case Keys.Enter:
case Keys.Tab:
UpdateDataGridCell(rowNum,colNum);
break;
default:
MessageBox.Show("Invalid character","Error");
break;
}
}
} Tag: Selecting Listview Item by Text Tag: 61703
Application Addins
I am interested in some resources to help in whether or not Addins to a
Windows Forms application is a good (solid) design to add functionality to
the application and also understanding the if anyone has had good and or bad
experiences.
Thanks in advance for all that participate.
Wade Tag: Selecting Listview Item by Text Tag: 61700
MSDN Sample - The ListManager's position must be equal to rowNum
Hi All,
I used DataGridComboBoxColumn from MSDN magazine (
http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx).
Normally things work fine.
but in the following cases I get an error 'The ListManager's
position must be equal to rowNum'.
================================
1) when I click on a comboboxcolumn cell
2) and scroll the datagrid
3) and click on another comboboxcolumn cell
OR
1) navigate to a tabpage other than the one datagrid is on
2) and navigate back to datagrid tabpage
3) and click on a comboboxcolumn cell
================================
Good news is I made a change to the code and the problem went away.
The bad news is I can't understand why!
Just wonder if the experts here might be able to help?
The change that I made to DataGridComboBoxColumn are
1) remove combobox.hide from datagrid_scroll event
2)add code in edit method to hide the combo when current cell is not
visible
(I'll attach both codes)
I have trace output for the following sequence of action
1) click on datagridcombobox column cell at row 3 (index 2)
2) then click on datagridcombobox column cell at row 5 (index 4)
3)scroll one cell
4)then click on datagridcombobox column cell at row 6 (index 5)
==============TRACE OUTPUT ORIGINAL CODE====================raises
the error
Edit 2
Leave: column1 column1
SetColumnValueAtRow 2 column1
Edit 4
-------------I scroll now
Edit 4
Leave: column1 column1
SetColumnValueAtRow 4 column1
Scroll
-------------combo hidden is hidden now
Leave: column1 column1
SetColumnValueAtRow 4 column1
Edit 4 <------things start to go wrong here? why is it entering edit
4...when it should be going to edit 5
Edit 5
Leave: column1 column1
SetColumnValueAtRow 4 column1
===============TRACE OUTPUT MODIFIED CODE====================no
errors raised here
Edit 2
Leave: column1 column1
SetColumnValueAtRow 2 column1
Edit 4
-------------scroll
Edit 4
Leave: column1 column1
SetColumnValueAtRow 4 column1
Scroll
-------------combo stays
Leave: column1 column1
SetColumnValueAtRow 4 column1
Edit 5
==================================
notice that things start to go a bit crazy in last 3-4 lines. The thing that
seems to cause the error is Edit method being called in the first case for
rowindex 4 and then rowindex5 immediately....unlike the second case....
It may not make much sense w/o the code so I attach both cases with the
mail.
====================ORIGINAL CODE===================
// Derive class from DataGridTextBoxColumn
public class DataGridComboBoxColumn : DataGridTextBoxColumn
{
// Hosted ComboBox control
private ComboBox comboBox;
private CurrencyManager cm;
private int iCurrentRow;
// Constructor - create combobox, register selection change event handler,
// register lose focus event handler
public DataGridComboBoxColumn()
{
this.cm = null;
// Create ComboBox and force DropDownList style
this.comboBox = new ComboBox();
this.comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
// Add event handler for notification of when ComboBox loses focus
this.comboBox.Leave += new EventHandler(comboBox_Leave);
}
// Property to provide access to ComboBox
public ComboBox ComboBox
{
get { return comboBox; }
}
// On edit, add scroll event handler, and display combo box
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string
instantText, bool cellIsVisible)
{
Debug.WriteLine(String.Format("Edit {0}", rowNum));
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
if (!readOnly && cellIsVisible)
{
// Save current row in the datagrid and currency manager associated with
// the data source for the datagrid
this.iCurrentRow = rowNum;
this.cm = source;
// Add event handler for datagrid scroll notification
this.DataGridTableStyle.DataGrid.Scroll += new
EventHandler(DataGrid_Scroll);
// Site the combo box control within the bounds of the current cell
this.comboBox.Parent = this.TextBox.Parent;
Rectangle rect = this.DataGridTableStyle.DataGrid.GetCurrentCellBounds();
this.comboBox.Location = rect.Location;
this.comboBox.Size = new Size(this.TextBox.Size.Width,
this.comboBox.Size.Height);
// Set combo box selection to given text
this.comboBox.SelectedIndex =
this.comboBox.FindStringExact(this.TextBox.Text);
// Make the ComboBox visible and place on top text box control
this.comboBox.Show();
this.comboBox.BringToFront();
this.comboBox.Focus();
}
// else
// {
// this.comboBox.Hide();
// }
}
// Given a row, get the value member associated with a row. Use the value
// member to find the associated display member by iterating over bound
datasource
protected override object
GetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum)
{
//Debug.WriteLine(String.Format("GetColumnValueAtRow {0}", rowNum));
// Given a row number in the datagrid, get the display member
object obj = base.GetColumnValueAtRow(source, rowNum);
// Iterate through the datasource bound to the ColumnComboBox
// Don't confuse this datasource with the datasource of the associated
datagrid
CurrencyManager cm = (CurrencyManager)
(this.DataGridTableStyle.DataGrid.BindingContext[this.comboBox.DataSource]);
// Assumes the associated DataGrid is bound to a DataView, or DataTable that
// implements a default DataView
DataView dataview = ((DataView)cm.List);
int i;
for (i = 0; i < dataview.Count; i++)
{
if (obj.Equals(dataview[i][this.comboBox.ValueMember]))
break;
}
if (i < dataview.Count)
return dataview[i][this.comboBox.DisplayMember];
return DBNull.Value;
}
// Given a row and a display member, iterating over bound datasource to find
// the associated value member. Set this value member.
protected override void
SetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum,
object value)
{
Debug.WriteLine(String.Format("SetColumnValueAtRow {0} {1}", rowNum,
value));
object s = value;
// Iterate through the datasource bound to the ColumnComboBox
// Don't confuse this datasource with the datasource of the associated
datagrid
CurrencyManager cm = (CurrencyManager)
(this.DataGridTableStyle.DataGrid.BindingContext[this.comboBox.DataSource]);
// Assumes the associated DataGrid is bound to a DataView, or DataTable that
// implements a default DataView
DataView dataview = ((DataView)cm.List);
int i;
for (i = 0; i < dataview.Count; i++)
{
if (s.Equals(dataview[i][this.comboBox.DisplayMember]))
break;
}
// If set item was found return corresponding value, otherwise return
DbNull.Value
if(i < dataview.Count)
s = dataview[i][this.comboBox.ValueMember];
else
s = DBNull.Value;
base.SetColumnValueAtRow(source, rowNum, s);
}
// On datagrid scroll, hide the combobox
private void DataGrid_Scroll(object sender, EventArgs e)
{
Debug.WriteLine("Scroll");
this.comboBox.Hide();
}
// On combo box losing focus, set the column value, hide the combo box,
// and unregister scroll event handler
private void comboBox_Leave(object sender, EventArgs e)
{
DataRowView rowView = (DataRowView) this.comboBox.SelectedItem;
string s = (string) rowView.Row[this.comboBox.DisplayMember];
Debug.WriteLine(String.Format("Leave: {0} {1}", this.comboBox.Text, s));
SetColumnValueAtRow(this.cm, this.iCurrentRow, s);
Invalidate();
this.comboBox.Hide();
this.DataGridTableStyle.DataGrid.Scroll -= new
EventHandler(DataGrid_Scroll);
}
}
===================================MODIFIED
CODE=========================================
// Derive class from DataGridTextBoxColumn
public class DataGridComboBoxColumn : DataGridTextBoxColumn
{
// Hosted ComboBox control
private ComboBox comboBox;
private CurrencyManager cm;
private int iCurrentRow;
// Constructor - create combobox, register selection change event handler,
// register lose focus event handler
public DataGridComboBoxColumn()
{
this.cm = null;
// Create ComboBox and force DropDownList style
this.comboBox = new ComboBox();
this.comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
// Add event handler for notification of when ComboBox loses focus
this.comboBox.Leave += new EventHandler(comboBox_Leave);
}
// Property to provide access to ComboBox
public ComboBox ComboBox
{
get { return comboBox; }
}
// On edit, add scroll event handler, and display combo box
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly, string
instantText, bool cellIsVisible)
{
Debug.WriteLine(String.Format("Edit {0}", rowNum));
base.Edit(source, rowNum, bounds, readOnly, instantText, cellIsVisible);
if (!readOnly && cellIsVisible)
{
// Save current row in the datagrid and currency manager associated with
// the data source for the datagrid
this.iCurrentRow = rowNum;
this.cm = source;
// Add event handler for datagrid scroll notification
this.DataGridTableStyle.DataGrid.Scroll += new
EventHandler(DataGrid_Scroll);
// Site the combo box control within the bounds of the current cell
this.comboBox.Parent = this.TextBox.Parent;
Rectangle rect = this.DataGridTableStyle.DataGrid.GetCurrentCellBounds();
this.comboBox.Location = rect.Location;
this.comboBox.Size = new Size(this.TextBox.Size.Width,
this.comboBox.Size.Height);
// Set combo box selection to given text
this.comboBox.SelectedIndex =
this.comboBox.FindStringExact(this.TextBox.Text);
// Make the ComboBox visible and place on top text box control
this.comboBox.Show();
this.comboBox.BringToFront();
this.comboBox.Focus();
}
else
{
this.comboBox.Hide();
}
}
// Given a row, get the value member associated with a row. Use the value
// member to find the associated display member by iterating over bound
datasource
protected override object
GetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum)
{
//Debug.WriteLine(String.Format("GetColumnValueAtRow {0}", rowNum));
// Given a row number in the datagrid, get the display member
object obj = base.GetColumnValueAtRow(source, rowNum);
// Iterate through the datasource bound to the ColumnComboBox
// Don't confuse this datasource with the datasource of the associated
datagrid
CurrencyManager cm = (CurrencyManager)
(this.DataGridTableStyle.DataGrid.BindingContext[this.comboBox.DataSource]);
// Assumes the associated DataGrid is bound to a DataView, or DataTable that
// implements a default DataView
DataView dataview = ((DataView)cm.List);
int i;
for (i = 0; i < dataview.Count; i++)
{
if (obj.Equals(dataview[i][this.comboBox.ValueMember]))
break;
}
if (i < dataview.Count)
return dataview[i][this.comboBox.DisplayMember];
return DBNull.Value;
}
// Given a row and a display member, iterating over bound datasource to find
// the associated value member. Set this value member.
protected override void
SetColumnValueAtRow(System.Windows.Forms.CurrencyManager source, int rowNum,
object value)
{
Debug.WriteLine(String.Format("SetColumnValueAtRow {0} {1}", rowNum,
value));
object s = value;
// Iterate through the datasource bound to the ColumnComboBox
// Don't confuse this datasource with the datasource of the associated
datagrid
CurrencyManager cm = (CurrencyManager)
(this.DataGridTableStyle.DataGrid.BindingContext[this.comboBox.DataSource]);
// Assumes the associated DataGrid is bound to a DataView, or DataTable that
// implements a default DataView
DataView dataview = ((DataView)cm.List);
int i;
for (i = 0; i < dataview.Count; i++)
{
if (s.Equals(dataview[i][this.comboBox.DisplayMember]))
break;
}
// If set item was found return corresponding value, otherwise return
DbNull.Value
if(i < dataview.Count)
s = dataview[i][this.comboBox.ValueMember];
else
s = DBNull.Value;
base.SetColumnValueAtRow(source, rowNum, s);
}
// On datagrid scroll, hide the combobox
private void DataGrid_Scroll(object sender, EventArgs e)
{
Debug.WriteLine("Scroll");
// this.comboBox.Hide();
}
// On combo box losing focus, set the column value, hide the combo box,
// and unregister scroll event handler
private void comboBox_Leave(object sender, EventArgs e)
{
DataRowView rowView = (DataRowView) this.comboBox.SelectedItem;
string s = (string) rowView.Row[this.comboBox.DisplayMember];
Debug.WriteLine(String.Format("Leave: {0} {1}", this.comboBox.Text, s));
SetColumnValueAtRow(this.cm, this.iCurrentRow, s);
Invalidate();
this.comboBox.Hide();
this.DataGridTableStyle.DataGrid.Scroll -= new
EventHandler(DataGrid_Scroll);
}
}
Thanks if you've got here... :-)
GK Tag: Selecting Listview Item by Text Tag: 61697
typed dataset on inherited form
There is obviously a bug in VS.NET 2003:
Steps to reproduce:
1.) Create typed DataSet with one unique key.
2.) Make WinForm and place a (visual) instance of the
typed DataSet on it.
3.) Create an inherited form (base on the first form).
4.) Place any control (button,...) on the second form.
When running the test-app, an exception is thrown.
(System.ArgumentException: Cannot add primary key
constraint since primary key is already set for the
table.)
Reason: VS generates code in the inherited form for the
dataset, which will add the same constraint again to the
dataset.
I found a thread, reporting this topic:
http://groups.google.at/groups?threadm=009801c31794%
24f74a5bb0%242f01280a%40phx.gbl
This thread is from May 03 and it says, that this is a
known bug and a KB-article regarding this issue is going
to be published. But I could not find anything! :(
Are there any solutions to this problem yet???
Thanks for any answer!!
Thomas Tag: Selecting Listview Item by Text Tag: 61696
window form style question
I am using VS.net 2003 to develop a simple window form by
using C#. I have added a menu in that simple window, as
follow:
http://destiny.xfiles.to/ubbthreads/files/383648-2.jpg
The style is the standard one, but i would like to change
to VS.net style, just like the following:
http://destiny.xfiles.to/ubbthreads/files/383646-1.jpg
how can i change the standard style to VS.net style?
thank you. Tag: Selecting Listview Item by Text Tag: 61689
What framework for MDI applications is recommended?
I came from a C++ MFC background to Windows Forms .NET
programming. Windows apps are best written on top of a
framework of some kind.
With Longhorn on its way, which framework for Windows
application programming is best as far as future Longhorn
compatibility?
Here is my contribution of a few ideas:
Microsoft Patterns and Practices Application Building
Blocks UI Process
Genghis: a GotDotNet workspace collaboration - MFC based.
A straight porting of MFC to .NET
However, I am not sure which is best and am looking for
ideas. Tag: Selecting Listview Item by Text Tag: 61680
Help Linking date to code
I have created a stored procedure which has a variable
called @date and I am trying to link this variable to the
date picker on my form but I need help. the code I have
done so far is below
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim sConnectionString As String = _
"server=localhost;uid=sa;pwd=sabril;dat
abase=optimussql"
Dim cnoptimus As New SqlConnection
(sConnectionString)
Dim cmdOrders As New SqlCommand("sales", cnoptimus)
cmdOrders.CommandType = CommandType.StoredProcedure
cmdOrders.Parameters.Add(New _
SqlParameter("@date", SqlDbType.VarChar, 11))
cmdOrders.Parameters("@date").Value = "MyDateValue"
Dim daGetOrders As New SqlDataAdapter(cmdOrders)
Dim dsOrders As New DataSet
daGetOrders.Fill(dsOrders, "st")
DataGrid1.DataSource = dsOrders.Tables("st")
End Sub
Private Sub DateTimePicker1_ValueChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs) Handles
MyDateValue.ValueChanged
End Sub
End Class
Can anyone help me with the code or point me to some info
that will detail how to link a date picker to a stored
procedure proc
Regards
Newman Tag: Selecting Listview Item by Text Tag: 61676
Collection
Hi again
I've been trying to erase an element from a Collection,
but when I do this I get this exception
Object reference not set to an instance of an object.
This is my code
IEnumerator ie = Panel.Controls.GetEnumerator();
while(ie.MoveNext()) {
CheckBox chk = new CheckBox();
chk = (CheckBox)ie.Current;
if(chk.checked) {
Panel.Controls.Remove(chk);
}
}
And when I comment the condition, it removes only some
elements, for example, if the panel has 27 elements, it
removes 10 and it leaves 17.
What's wrong??
Regards Tag: Selecting Listview Item by Text Tag: 61675
Troubles with TreeViews
I am experiencing strange behavior from the Standard
Windows Forms TreeView control.
My application retrieves a dataset from a Web-Service. If
the download was sucessful, I call the Dataset.WriteXml()
method to persist the dataset to the local disk. The
next time the app runs, I check to see if the Xml file
exists, and if it does, I call ReadXml() instead of going
to the webservice. (The data doesn't change often).
From the dataset, I generate a six-level treeview.
Everything works fine the first time, until I choose to
refresh the dataset, and re-generate the treeview. The
tree goes blank, except for a single plus/minus image.
When I click on the 'node', it seems to expand, but no
data is being displayed.
I am doing the following when I refresh the data:
1. Clear the contents of the dataset
2. Retrieve the data again from the web-service
3. Remove all nodes from the tree-view
4. Re-build all nodes from the dataset
This process works great when I first run the program,
but when I try to refresh the dataset while it is
running, it gives me grief.
Anyone have any ideas? Sorry for the long winded
explanation. Any help would be appreciated.
........./mike Tag: Selecting Listview Item by Text Tag: 61674
ListView Paint
I got no answer before, so I'm reposting.
I have built a listview which I change the Size and View properties at run
time.
The imagelist associated to SmallList and LargeList properties is the same.
The problem is that it works great when View = LargeIcons, but it shows
blank/no icons at all when I set View to anything else. But, minimizing the
window OR sorting the listview solves the problem.
Seeing that I don't want to do any of these 2 things as a workaround, and
listview.Refresh() doesnt work at all, does anybody have any suggestion on
how to refresh the listview?
I have read something about Listview not invoking the Paint event.
Thanks! Tag: Selecting Listview Item by Text Tag: 61673
SQL server database
This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C3B07E.0840D3E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
How can I create a SQL server database in my VB.NET program?
I've MSSQLServer installed and running.
If a database is created, where is it stored?
I used the following code, didn't get any errors, but cannot find a new =
file:
Dim con As SqlConnection =3D New =
SqlConnection("server=3D(local);Integrated =
Security=3DSSPI;database=3DSiteList")
Dim cmdLijst As SqlDataAdapter =3D New SqlDataAdapter("CREATE DATABASE =
", con)
'here some code to create the table?
'here some code to put the info from a dataset into the sql =
database?
con.close
Is with this code the database created?
thanks
Eric
------=_NextPart_000_000A_01C3B07E.0840D3E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>How can I create a SQL server database =
in my VB.NET=20
program?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I've MSSQLServer installed and=20
running.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If a database is created, where is it=20
stored?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I used the following code, didn't get =
any errors,=20
but cannot find a new file:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Dim con As SqlConnection =3D New=20
SqlConnection("server=3D(local);Integrated=20
Security=3DSSPI;database=3DSiteList")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Dim cmdLijst As SqlDataAdapter =3D New=20
SqlDataAdapter("CREATE DATABASE ", con)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> 'here some code to =
create the=20
table?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> 'here some code to =
put the info=20
from a dataset into the sql database?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>con.close</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Is with this code the database=20
created?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Eric</FONT></DIV></BODY></HTML>
------=_NextPart_000_000A_01C3B07E.0840D3E0-- Tag: Selecting Listview Item by Text Tag: 61661
How does a MDIParent position its children
We are trying to control the cascading of mdi children as they open up. We
can do this with some success in the mdi child but it seems the parent
overrides what we do. What does a mdiparent do in regards to positioning
its child forms? Is there a way prior to or on the call to show to tell the
mdiparent where to position the child? Tag: Selecting Listview Item by Text Tag: 61655
converting a word doc into a pdf from a vb.net form
Hello everybody,
I have a treeview populated with folders and files shown on a WinForm. Some
files are word doc shown ..
I want to convert those doc into pdf and reload them ....and shown again on
the treeview..
can anybody help...
Appreciated
Thank u Tag: Selecting Listview Item by Text Tag: 61654
Stupid App.Config Question
I have a client app as one project and a data access class
library as another project. I have put app.config files
everywhere and named them everything. If I name it
MyApp.exe.config and put it in the client's bin directory,
the client can get to it but I can't make the data access
assembly access it.
Any Ideas?
Thanks Tag: Selecting Listview Item by Text Tag: 61653
Changes tracking
Hello,
Is there a mechanism allowing to know if the user has made a change in a
form containing many controls?
Thanks for help. Tag: Selecting Listview Item by Text Tag: 61652
Rename a folder maintaining its content from a VB.NET Form
Hello everybody,
Is it possible to rename a folder before showing it on a treeview on a
VB.NET form..The property .name is readonly..
can anybody help..
Thank u Tag: Selecting Listview Item by Text Tag: 61640
Make Container UserControl force controls to be added to a child container control
Hi,
I'm writing a container usercontrol. It consists of two panels. The first
panel is designed to act as a titlebar for the usercontrol. I want the
second panel to become the place where other controls are contained when
dropped on to it from a form designer (so they can never be positioned on
top of the title).
Is there any way of fooling the windows forms designer into adding contained
controls into the second panel, instead of the usercontrol itself?
I appreciate any help anyone can give me.
Thanks,
Trev. Tag: Selecting Listview Item by Text Tag: 61635
Question on MDI Forms Resizing and .Net Bug
When using an C# MDI Form, I have set the Child form's Minimize and Maximize
buttons to false, so they do not show up. But when I maximize the program
to fit a larger size window then what the default size is of the MDI Parent
is set to (programming this for a specific screen size), the Maximize and
Minimize buttons show up on the child form which can cause issues if someone
inadvertently uses them
I know this has been discussed before, and people have stated it is a bug in
.Net.
What I was wondering is if there are any examples of a code snippet that
finds the Size of the MDI Parent, then changes the size of the MDI Child
(similar to maximizing the Child form) so that the MDI Child will then be
"maximized" without initating that part of the .Net code. I was wondering
if by doing that throw separate code, the maximize and minimize buttons
would then not appear, and I could get around this problem.
Does anyone know of any examples, or something that could lead me down a
path to solving this?
Thanks,
T.Waldren Tag: Selecting Listview Item by Text Tag: 61632
Controls binded to datasource
This is a multi-part message in MIME format.
------=_NextPart_000_0008_01C3B04D.F9AEAAD0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello!
I have a panel in a form where to add controls, where the properties are =
loaded from a database, and the properties also are visible in a =
gridview (from developers express). The strange thing is that when I =
change the row in the gridview that object will be the visible one, and =
when checking (for each control...) the controls in the panel it's =
properties are equal to eachother, which they shouldn't (are not in the =
database). I think I've missed something with the binding, but I can't =
figure out what. Below you can see some of my code which loads the =
controls into the tab:
Regards Magnus
Private Sub LoadControlsTmp()
Dim st As String =3D "Prospects_Controls"
Dim cmd As New SqlClient.SqlCommand("select * from " & st & " where =
_TabID=3D" & cmbTabs.SelectedItem.IntID, cn)
da.SelectCommand =3D cmd
If ds.Tables.Count > 0 Then ds.Tables.Clear()
da.Fill(ds, st)
Panel3.Controls.Clear()
Dim dv As DataView =3D ds.Tables(st).DefaultView
GrdControl3.DataSource =3D dv
Dim drCTRL As DataRowView
For Each drCTRL In dv
Dim obj As New TextBox
obj.DataBindings.Add(New Binding("Text", dv, "CtrlText"))
obj.DataBindings.Add(New Binding("Name", dv, "CtrlName"))
Panel3.Controls.Add(obj)
Next
End Sub
------=_NextPart_000_0008_01C3B04D.F9AEAAD0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2713.1100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hello!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I have a panel in a form where to add =
controls,=20
where the properties are loaded from a database, and the properties also =
are=20
visible in a gridview (from developers express). The strange thing is =
that when=20
I change the row in the gridview that object will be the visible one, =
and when=20
checking (for each control...) the controls in the panel it's =
properties=20
are equal to eachother, which they shouldn't (are not in the database). =
I think=20
I've missed something with the binding, but I can't figure out what. =
Below you=20
can see some of my code which loads the controls into the =
tab:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Regards Magnus</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff>Private</FONT> <FONT=20
color=3D#0000ff>Sub</FONT></FONT><FONT face=3DArial>=20
LoadControlsTmp()</FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
Dim</FONT> st <FONT color=3D#0000ff>As</FONT> <FONT=20
color=3D#0000ff>String</FONT></FONT><FONT face=3DArial> =3D=20
"Prospects_Controls"</FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
Dim</FONT> cmd <FONT color=3D#0000ff>As</FONT> <FONT=20
color=3D#0000ff>New</FONT></FONT><FONT face=3DArial> =
SqlClient.SqlCommand("select *=20
from " & st & " where _TabID=3D" & =
cmbTabs.SelectedItem.IntID,=20
cn)</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D1> da.SelectCommand =3D =
cmd</FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
If</FONT> ds.Tables.Count > 0 <FONT =
color=3D#0000ff>Then</FONT></FONT><FONT=20
face=3DArial> ds.Tables.Clear()</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D1> da.Fill(ds, =
st)</FONT></DIV>
<DIV><FONT face=3DArial size=3D1> =20
Panel3.Controls.Clear()</FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
Dim</FONT> dv <FONT color=3D#0000ff>As</FONT></FONT><FONT face=3DArial> =
DataView =3D=20
ds.Tables(st).DefaultView</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D1> =
GrdControl3.DataSource =3D=20
dv</FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
Dim</FONT> drCTRL <FONT color=3D#0000ff>As</FONT></FONT><FONT =
face=3DArial>=20
DataRowView</FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
For</FONT> <FONT color=3D#0000ff>Each</FONT> drCTRL <FONT=20
color=3D#0000ff>In</FONT></FONT><FONT face=3DArial> =
dv</FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial><FONT =
color=3D#0000ff> =20
Dim</FONT> obj <FONT =
color=3D#0000ff>As</FONT></FONT><FONT=20
face=3DArial> <FONT color=3D#0000ff>New</FONT><FONT face=3DArial>=20
TextBox</FONT></FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT =
face=3DArial> =20
obj.DataBindings.Add(</FONT><FONT face=3DArial =
color=3D#0000ff>New</FONT><FONT=20
face=3DArial> Binding("Text", dv, "CtrlText"))</FONT></FONT></DIV>
<DIV><FONT size=3D1><FONT face=3DArial> =
=20
obj.DataBindings.Add(</FONT><FONT face=3DArial =
color=3D#0000ff>New</FONT><FONT=20
face=3DArial> Binding("Name", dv, "CtrlName"))</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D1> =20
Panel3.Controls.Add(obj)</FONT></DIV>
<DIV><FONT color=3D#0000ff><FONT face=3DArial =
size=3D1> =20
Next</FONT></DIV></FONT>
<DIV><FONT face=3DArial><FONT size=3D1><FONT color=3D#0000ff>End</FONT> =
<FONT=20
color=3D#0000ff>Sub</DIV></FONT></FONT></FONT></BODY></HTML>
------=_NextPart_000_0008_01C3B04D.F9AEAAD0-- Tag: Selecting Listview Item by Text Tag: 61630
Howto Convert Icon to Image
Hello,
I have a very simple problem; maybe the answer is simple, too, but I did not
find one until now:
I have a System.Drawing.Icon object where I need a System.Drawing.Image
object.
How can I convert the Icon into an Image?
Dirk Ströker Tag: Selecting Listview Item by Text Tag: 61625
I have a listview with items Apple, Pear, Banana. How can I
programmatically select Pear if I don't know the index?