BUG: ComboBox.OnSelectedItemChanged
I found the following bug:
When manualy selecting a new item from a ComboBox the OnSelectedItemChanged
is not called. When settings SelectedItem or SelectedIndex from code, it is
correctly called. A small test program to duplicate the bug follows:
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace BugTester
{
public class BugForm : System.Windows.Forms.Form
{
private TestComboBox comboBox1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public BugForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new BugTester.TestComboBox();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.DropDownStyle =
System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.Items.AddRange(new object[] {
"Item 1",
"Item 2",
"Item 3"});
this.comboBox1.Location = new System.Drawing.Point(8, 8);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(280, 21);
this.comboBox1.TabIndex = 0;
//
// BugForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 38);
this.Controls.Add(this.comboBox1);
this.Name = "BugForm";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
protected override void OnLoad( EventArgs e )
{
Debug.WriteLine( "Setting Selected Index" );
comboBox1.SelectedIndex = 1;
Debug.WriteLine( "Setting Selected Item" );
comboBox1.SelectedItem = comboBox1.Items[2];
Debug.WriteLine( "Now selected an item manualy" );
base.OnLoad( e );
}
[STAThread]
static void Main()
{
Application.Run( new BugForm() );
}
}
public class TestComboBox : ComboBox
{
protected override void OnSelectedIndexChanged( EventArgs e )
{
Debug.WriteLine( "OnSelectedIndexChanged called" );
base.OnSelectedIndexChanged( e );
}
// this method is not called when manualy selecting a new item in
the combobox
protected override void OnSelectedItemChanged(EventArgs e)
{
Debug.WriteLine( "OnSelectedItemChanged called" );
base.OnSelectedItemChanged( e );
}
}
} Tag: How to make Combobox readonly Tag: 64281
PropertyGrid using DefaultValue attribute - MUST IT ??
Is there ANY way you can persuade a property grid control to use something
else for each property's default value, and not the DefaultValue attribute
(attributes as far as I can see are read-only - is this right?).
I want to base a PropertyGrid control on a single class but to have the
default values for each property different for each instance of the class.
CAN THIS BE DONE ?? Tag: How to make Combobox readonly Tag: 64280
autodoc feature in vb.net?
Hi,
I know there is an autodocument feature in C# which translates in-code
comments and parameterinformation, etc... into xml documentation. Ideal
stuff for documenting a framework.
Does such a tool exist for vb.net as wel?
i'd appreciate all help on this topic!
Bonna Tag: How to make Combobox readonly Tag: 64274
quick money
To: everyone
Topic: a way to make money quick easy and legally=20
HOW TO TURN $6 into $6,000 !!!!!! Remember: play FAIRLY=20
and HONESTLY and this will really work. I found this on a=20
bulletin board and decided to try it. A little while back,=20
I was browsing through newsgroups, just like you are now,=20
and came across an article similar to this that said you=20
could make thousands of dollars within weeks with only an=20
initial investment of $6.00! So I thought, Yeah right,=20
this must be a scam,but like most of us, I was curious, so=20
I kept reading. Anyway, it said that you send $1.00 to=20
each of the 6 names and address stated in the article. You=20
then place your own name and address in the bottom of the=20
list at #6, and post the article in at least 200=20
newsgroups. (There are thousands) No catch, that was it.=20
So after thinking it over, and talking to a few people=20
first, I thought about trying it. I figured: what have I=20
got to lose except 6 stamps and $6.00, right? Then I=20
invested the measly $6.00. Well GUESS WHAT!!... within 7=20
days, I started getting money in the mail! I was shocked!=20
I figured it would end soon, but the money just kept=20
coming in. In my first week, I made about $25.00. By the=20
end of the second week I had made a total of over=20
$1,000.00! In the third week I had over $10,000.00 and=20
it's still growing. This is now my fourth week and I have=20
made a total of just over $42,000.00 and it's still coming=20
in rapidly. It's certainly worth $6.00, and 6 stamps, I=20
have spent more than that on the lottery!! Let me tell you=20
how this works and most importantly, why it works....Also,=20
make sure you print a copy of this article NOW, so you can=20
get the information off of it as you need it. I promise=20
you that if you follow the directions exactly, that you=20
will start making more money than you thought possible by=20
doing something so easy! Suggestion: Read this entire=20
message carefully! (print it out or download it.) Follow=20
the simple directions and watch the money come in! It's=20
easy. It's legal. And, your investment is only $6.00 (Plus=20
postage) IMPORTANT: This is not a rip-off; it is not=20
indecent; it is not illegal; and it is virtually no risk -=20
it really works!!!! If all of the following instructions=20
are adhered to, you will receive extraordinary dividends.=20
PLEASE NOTE: Please follow these directions EXACTLY, and=20
$50,000 or more can be yours in 20 to 60 days. This=20
program remains successful because of the honesty and=20
integrity of the participants. Please continue its success=20
by carefully adhering to the instructions. You will now=20
become part of the Mail Order business. In this business=20
your product is not solid and tangible, it's a service.=20
You are in the business of developing Mailing Lists. Many=20
large corporations are happy to pay big bucks for quality=20
lists. However, the money made from the mailing lists is=20
secondary to the income which is made from people like you=20
and me asking to be included in that list. Here are the 4=20
easy steps to success: STEP 1: Get 6 separate pieces of=20
paper and write the following on each piece of=20
paper;PLEASE PUT ME ON YOUR MAILING LIST. Now get 6 US=20
$1.00 bills and place ONE inside EACH of the 6 pieces of=20
paper so the bill will not be seen through the envelope=20
(to prevent thievery). Next, place one paper in each of=20
the 6 envelopes and seal them. You should now have 6=20
sealed envelopes, each with a piece of paper stating the=20
above phrase, your name and address, and a $1.00 bill.=20
What you are doing is creating a service. THIS IS=20
ABSOLUTELY LEGAL! You are requesting a legitimate service=20
and you are paying for it! Like most of us I was a little=20
skeptical and a little worried about the legal aspects of=20
it all. So I checked it out with the U.S. Post Office (1-
800-725-2161) and they confirmed that it is indeed legal!=20
Mail the 6 envelopes to the following addresses: #1) Jeff=20
Millan 1113 N. 19 =BD McAllen,TX 78501 #2) simon white 23=20
mason road stroud glostershire eng #3) Wayne Clark 146=20
Poningo St. Port Chester, NY 105 #4) T. brayford dotburn=20
park road stroud glos eng gl5 2jf #5) Alan Meyer 17725 W.=20
Belmont Ave. Kerman, CA 93630 #6) Joshua North 17415 W.=20
Whitesbridge Kerman, CA 93630 STEP 2: Now take the #1 name=20
off the list that you see above, move the other names up=20
(6 becomes 5, 5 becomes 4, etc...) and add YOUR Name as=20
number 6 on the list. STEP 3: Change anything you need to,=20
but try to keep this article as close to original as=20
possible. Now, post your amended article to at least 200=20
newsgroups. (I think there are close to 100,000 groups)=20
All you need is 200, but remember, the more you post, the=20
more money you make! This is perfectly legal! If you have=20
any doubts, refer to Title 18 Sec. 1302 & 1341 of the=20
Postal lottery laws. Keep a copy of these steps for=20
yourself and, whenever you need money, you can use it=20
again, and again. PLEASE REMEMBER that this program=20
remains successful because of the honesty and integrity of=20
the participants and by their carefully adhering to the=20
directions. Look at it this way. If you are of integrity,=20
the program will continue and the money that so many=20
others have received will come your way. NOTE: You may=20
want to retain every name and address sent to you, either=20
on a computer or hard copy and keep the notes people send=20
you. This VERIFIES that you are truly providing a service.=20
(Also, it might be a good idea to wrap the $1 in dark=20
paper to reduce the risk of mail theft.) So, as each post=20
is downloaded and the directions carefully followed, six=20
members will be reimbursed for their participation as a=20
List Developer with one dollar each. Your name will move=20
up the list geometrically so that when your name reaches=20
the #1 position you will be receiving thousands of dollars=20
in CASH!!! What an opportunity for only$6.00 ($1.00 for=20
each of the first six people listed above) Send it now,=20
add your own name to the list and you're in business! ---
DIRECTIONS ----- FOR HOW TO POST TO NEWSGROUPS------------=20
Step 1) You do not need to re-type this entire letter to=20
do your own posting. Simply put your cursor at the=20
beginning of this letter and drag your cursor to the=20
bottom of this document, and select 'copy' from the edit=20
menu. This will copy the entire letter into the computer's=20
memory. Step 2) Open a blank 'notepad' file and place your=20
cursor at the top of the blank page. From the 'edit' menu=20
select 'paste'. This will paste a copy of the letter into=20
notepad so that you can add your name to the list. Step 3)=20
Save your new notepad file as a .txt file. If you want to=20
do your postings in different settings, you'll always have=20
this file to go back to. Step 4) Use Netscape or Internet=20
explorer and try searching for various newsgroups (on-line=20
forums, message boards, chat sites, discussions.) Step 5)=20
Visit these message boards and post this article as a new=20
message by highlighting the text of this letter and=20
selecting paste from the edit menu. Fill in the Subject,=20
this will be the header that everyone sees as they scroll=20
through the list of postings in a particular group, click=20
the post message button. You're done with your first one!=20
Congratulations...THAT'S IT! All you have to do is jump to=20
different newsgroups and post away, after you get the hang=20
of it, it will take about 30 seconds for each newsgroup!=20
**REMEMBER, THE MORE NEWSGROUPS YOU POST IN, THE MORE=20
MONEY YOU WILL MAKE!! BUT YOU HAVE TO POST A MINIMUM OF=20
200** That's it! You will begin receiving money from=20
around the world within days! You may eventually want to=20
rent a P.O.Box due to the large amount of mail you will=20
receive. If you wish to stay anonymous, you can invent a=20
name to use, as long as the postman will deliver it.=20
**JUST MAKE SURE ALL THE ADDRESSES ARE CORRECT.** Now the=20
WHY part: Out of 200 postings, say I receive only 5=20
replies (a very low example). So then I made $5.00 with my=20
name at #6 on the letter. Now, each of the 5 persons who=20
just sent me $1.00 make the MINIMUM 200 postings, each=20
with my name at #5 and only 5 persons respond to each of=20
the original 5, that is another $25.00 for me, now those=20
25 each make 200 MINIMUM posts with my name at #4 and only=20
5 replies each, I will bring in an additional $125.00!=20
Now, those 125 persons turn around and post the MINIMUM=20
200 with my name at #3 and only receive 5 replies each, I=20
will make an additional $626.00! OK, now here is the fun=20
part, each of those 625 persons post a MINIMUM 200 letters=20
with my name at #2 and they each only receive 5 replies,=20
that just made me $3,125.00!!! Those 3,125 persons will=20
all deliver this message to 200 newsgroups with my name at=20
#1 and if still 5 persons per 200 newsgroups react I will=20
receive $15,625,00! With an original investment of only=20
$6.00! AMAZING! When your name is no longer on the list,=20
you just take the latest posting in the newsgroups, and=20
send out another $6.00 to names on the list, putting your=20
name at number 6 again. And start posting again. The thing=20
to remember is: do you realize that thousands of people=20
all over the world are joining the internet and reading=20
these articles everyday?, JUST LIKE YOU are now!! So, can=20
you afford $6.00 and see if it really works?? I think=20
so... People have said, "e;what if the plan is played out=20
and no one sends you the money? So what! What are the=20
chances of that happening when there are tons of new=20
honest users and new honest people who are joining the=20
internet and newsgroups everyday and are willing to give=20
it a try? Estimates are at 20,000 to 50,000 new users,=20
every day, with thousands of those joining the actual=20
internet. Remember: play FAIRLY and HONESTLY and this will=20
really work.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
BE AN=20
INTERNET MILLIONAIRE LIKE OTHERS WITHIN A YEAR!!! Before=20
you say ''Bull'', please read the following. This is the=20
letter you have been hearing about on the news lately. Due=20
to the popularity of this letter on the Internet, a=20
national weekly news program recently devoted an entire=20
show to the investigation of this program described below,=20
to see if it really can make people money. The show also=20
investigated whether or not the program was legal. Their=20
findings proved once and for all that there=20
are ''absolutely NO Laws prohibiting the participation in=20
the program and if people can "follow the simple=20
instruction" they are bound to make some mega bucks with=20
only $6 out of pocket cost''. DUE TO THE RECENT INCREASE=20
OF POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT IS=20
CURRENTLY WORKING BETTER THAN EVER. This is what one had=20
to say: '' Thanks to this profitable opportunity". I was=20
approached many times before but each time I passed on it.=20
I am so glad I finally joined just to see what one could=20
expect in return for the minimal effort and money=20
required. To my astonishment, I received a total=20
$610,470.00 in 21 weeks, with money still coming in''. Pam=20
Hedland, Fort Lee, New Jersey.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
Another=20
said: "this program has been around for a long time but I=20
never believed in it. But one day when I received this=20
again in the mail I decided to gamble my $6 on it. I=20
followed the simple instructions and walaa ..... 3 weeks=20
later the money started to come in. First month I only=20
made $240.00 but the next 2 months after that I made a=20
total of $290,000.00. So far, in the past 8 months by re-
entering the program, I have made over $710,000.00 and I=20
am playing it again. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
TESTIMONIALS=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D '' My name is Mitchell.=20
My wife, Jody and I live in Chicago. I am an accountant=20
with a major U.S. Corporation and I make pretty good=20
money. When I received this program I grumbled to Jody=20
about receiving ''junk mail''. I made fun of the whole=20
thing, spouting my knowledge of the population and=20
percentages involved. I ''knew'' it wouldn't work. Jody=20
totally ignored my supposed intelligence and few days=20
later she jumped in with both feet. I made merciless fun=20
of her, and was ready to lay the old ''I told you so'' on=20
her when the thing didn't work. Well, the laugh was on me!=20
Within 3 weeks she had received 50 responses. Within the=20
next 45 days she had received total $ 147,200.00 .........=20
all cash! I was shocked. I have joined Jodyin=20
her ''hobby ''. Mitchell Wolf M.D., Chicago, Illinois=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D '' =
Not=20
being the gambling type, it took me several weeks to make=20
up my mind to participate in this plan. But conservative=20
as I am, I decided that the initial investment was so=20
little that there was just no way that I wouldn't get=20
enough orders to at least get my money back''. '' I was=20
surprised when I found my medium size post office box=20
crammed with orders. I made $319,210.00 in the first 12=20
weeks. The nice thing about this deal is that it does not=20
matter where people live. There simply isn't a better=20
investment with a faster return and so big''. Dan=20
Sondstrom, Alberta, Canada=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =
'' I had=20
received this program before. I deleted it, but later I=20
wondered if I should have given it a try. Of course, I had=20
no idea who to contact to get another copy, so I had to=20
wait until I was e-mailed again by someone else.........11=20
months passed then it luckily came again...... I did not=20
delete this one! I made more than $490,000 on my first try=20
and all the money came within 22 weeks''. Susan De Suza,=20
New York, N.Y.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =
'' It=20
really is a great opportunity to make relatively easy=20
money with little cost to you. I followed the simple=20
instructions carefully and within 10 days the money=20
started to come in. My first month I made $ 20, 560.00 and=20
by the end of third month my total cash count was $=20
362,840.00. Life is beautiful, Thanx to internet''. Fred=20
Dellaca, Westport, New Zealand=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = Tag: How to make Combobox readonly Tag: 64271
AsyncCallback + Exception
How can you pass an exception from an endInvoke statement in an
AsyncCallback Function to the Main Application Thread.
e.g.
Sub Main
Dim ar As IAsyncResult
ar = a.BeginSlowExponent(5, 200, New AsyncCallback(AddressOf
Me.OnEndSlowExponent), a)
End Sub
Public Sub OnEndSlowExponent(ByVal ar As IAsyncResult)
Try
Me.Text = a.EndSlowExponent(ar)
Catch ex As Exception
throw ex 'How do you send this to UI thread.
End Try
End Sub
Any Thoughts?
Thanks
MS Tag: How to make Combobox readonly Tag: 64264
Looking for an equivalent in .NET framework / WindowsForms
Hello,
I come from the Delphi world which has what is called a TActionList.
In a nutshell, an action list is a way to centralize the response to user
commands (actions). Action list components maintain a list of actions that
are available to the client controls in an application. These actions also
hold the images related to the actions.
I place my relavent code in the action and just assign that action to the
action property on the control (button, menu, popup menu, etc.). I can then
control the action which will in turn affect all controls that have that
action assigned to them. For example, I can disable an action and the menu,
toolbar, and popup menu all reflect that disabled state.
Is there anything in WindowsForms or, at a lower level, the .NET frameworld
that works similarly?
Thanks for you input. Tag: How to make Combobox readonly Tag: 64261
What's the point of Simple Data Binding?
Hello All,
In two different books, Simple Data Binding to a control is explained
with an example of a TextBox where the data is initialized with an
array.
For example a class is defined as such:
public class Vendor
{
private string vendorName;
public string VendorName
{
get
{
return vendorName;
}
set
{
vendorName = value;
}
}
public Vendor(string strVendorName)
{
VendorName = strVendorName;
}
}
}
A TextBox is placed on the main form Form1 with the following code:
public Vendor[] aVendors;
private void Form1_Load(object sender, System.EventArgs e)
{
this.aVendors = new Vendor[3];
aVendors[0] = new Vendor("Microsoft");
aVendors[1] = new Vendor("Praxis");
aVendors[2] = new Vendor("Rational");
txtVendor.DataBindings.Add("Text",aVendors,"VendorName");
}
where txtVendor is the name of the TextBox.
My question now is what else can you do with this? What's the point?
Is there some utilitarian advantage here that I am not seeing?
Neither of the texts expands on this. They both go into Complex Data
Binding which is a different animal. FYI,I am coming from the MFC VC++
world is that means anything.
Thanks,
Joe
I can also be reached at:
filter1_at_digitalchickenDOTnetNOSPAM Tag: How to make Combobox readonly Tag: 64260
No Touch Deployment Error Question
HI,
I am getting this error when I try to create a new instance of one of my
forms.
--
System.Security.SecurityException: Security error.
--
This error is thrown in the CTOR on the MyBase.New() call.
At this stage I have already created and displayed several other forms right
before this step, so it doesn't make sense why this particular form would
fail it is just a Standard windows form, with Menus/toolbars on it. It
doesn't even tell my what kind of security error
TIA,
--
Paul Tag: How to make Combobox readonly Tag: 64259
DataGrid DataMember changes
Hello,
I have a DataSet of multiple related tables that I display
in a DataGrid. When the user drills down to a child table,
or when he "drills back up" to the parent table, I want to
populate a ComboBox with the names of the columns in the
currently-displayed table.
I've done some playing around with a currency manager for
the DataMember of the grid, but it doesn't really give me
what I want.
Any suggestions for how to attack this? I'm stumped. The
problem is with finding out when the user has changed the
table he is viewing (and determining what the new table
is). I can handle getting the info into the combobox.
Many thanks,
Fred Noltie Tag: How to make Combobox readonly Tag: 64254
Can't Shutdown with System Tray Application Running
I have created a System Tray application that works as expected until the
user tries to shutdown. The computer will not shutdown because the System
Tray application is still running.
Can someone please provide an example of how to close the application
automatically if the user chooses to shutdown without the user explicitly
closing the application itself?
Thanks -
Michael Hetrick Tag: How to make Combobox readonly Tag: 64249
FileSystemWatcher
I am using VB.NET and the FileSystemWatcher monitoring a
network drive. Periodically I will get an error such as
this:
A first chance exception of
type 'System.Net.Sockets.SocketException' occurred in
system.dll
Additional information: An existing connection was
forcibly closed by the remote host
How can I trap this error and re-establish a connection
in order to continue monitoring the directory on the
network? The application I have written must run
continuously, 24..7.
Thanks,
Robert Tag: How to make Combobox readonly Tag: 64247
Security Issue
The issue I am dealing with has to do with trusting an
assembly (EXE) that physically resides on a network drive
but is being accessed and run locally on a user's
machine. When setting the icon up on each user's
machine, I have to run the Framework 1.1 Wizard that
allows me to browse to the Assembly (EXE) on the network
and set the trust to full trust. I want to be able to
accomplish this in a setup program. Is this possible?
Thanks,
Robert Tag: How to make Combobox readonly Tag: 64245
SDL Data Adapter and Parameter
All,
What or how should I go about using a data adapter parameter? Here is my
question.
I have a data adapter and some records are filtered with @ContactID.
Sometimes I want to add an additional parameter to this of @ClientID. As
expected, if I add this to the data adapter configuration, I have to supply
a value for it. So, is there a string or character like'*' that will return
all the records.
In essence, I want to be able to do:
With daLead.SelectCommand.Parameters
.Item("@ContactID").Value = 123
.Item("@ClientD").Value = "Every Single integer. Something like *"
End With
OR at other times....
With daLead.SelectCommand.Parameters
.Item("@ContactID").Value = 123
.Item("@ClientD").Value = 567
End With
--
Brian P. Hammer Tag: How to make Combobox readonly Tag: 64243
Debugging a No Touch Deployment Application
Hi,
I have tried several different methods, but I havn't been able to get Visual
Studio.NET debugger to attach to my application when I launch it from a web
site. I have set up the project properties to launch URL. The URL I launch
is the virtual directory I have set up for the Application. i.e.
http://localhost/MyApp/MyApp.exe , which is the same directory I have the
build set to.
The application launches, but I don't get any debugging.
Does anyone know how to accomplish this.
TIA,
--
Paul Tag: How to make Combobox readonly Tag: 64242
No Touch Deployment Question
Hi,
Is there anyway to get rid of the annoying 'balloon' caption that shows up
everytime you display a form? The one that says it is running only in a
partially trusted environment.
TIA,
--
Paul Tag: How to make Combobox readonly Tag: 64239
Custom Control Properties in WinRes
Hopefully someone out there can answer this question. It seems like a basic
problem, but I can't figure out what's wrong.
I have a form with a custom control that I want someone else to localize
with WinRes. When you load the .resx file with WinRes, and the custom
control assembly is in a place that WinRes can find it, it displays all the
controls properly, including the custom control, but not all of the
properties are available for editing in WinRes.
Is there something I'm missing? I have source for the control - do I need
to add something to the control so that WinRes can display the properties of
the control?
Thanks!
Terry Tag: How to make Combobox readonly Tag: 64238
Avoiding focus
I am trying to create a virtual keypad control for my
client's touch screen application (using Windows XP). I
have created a form, which I call Keypad, and in
CreateParameters have added WS_EX_NOACTIVATE to the
CreateParameter's ExStyle. This is supposed to tell the
form to not take focus. I put a label on the form and
hook into the Click event.
I start my main application form, which has a text box
control on it. I open my Keypad form, then select some
text in the main application's text box. When I click on
the label, the Keypad grabs focus and the selection in my
applications text box loses focus. I've tried several
things, but can't get the Keypad form to avoid grabbing
focus.
Can someone tell me what I am missing here? Tag: How to make Combobox readonly Tag: 64233
Localization and winres
Hi,
I just ran into the localization utility "winres.exe". This is a pretty
handy little thing for translators, but one thing puzzled me:
Lets say I have a form with a single button on it. Caption is "button1".
Translator translates and I get the new resource file.
So fra so good. Now I decide that my form needs another button for v2 of my
application. Then what? If I send the translator the same default resource
file, he would have to start all over (not that big a deal with two buttons,
but what if there were 27 buttons and just as many labels).
Am I missing something here?
Best regards,
Sebastian Tag: How to make Combobox readonly Tag: 64231
MouseUp event is raised when I double click my MDI form caption bar
Hi everybody:
I have a MDI application which has MDI forms containing every form a
list view that shows files and folders like Windows Explorer.
I have my own implementation of the context menu, so, I
programatically show it when the mouseUp event is raised over the list
view and the mouse button is the right button (quite obvious).
My problem occurs when I show the context menu, and after I maximize
the MDI form double-clicking the caption bar: My context menu is shown
again because the mouse up of the list view is raised!!!!
I searched in this group and I did not found similar problems and I
have no idea to solve this problem because the MouseEventArgs object
that my OnMouseUp() method receives is valid.
Any help will be very useful. Thanks in advance
Ernesto Tag: How to make Combobox readonly Tag: 64222
Visible = False on Form_Closing...
Hi,
I have a MDIForm with some MDIChilds. When the user clicks on the "x" in the
upper right corner, I don't want the MDIChild to be closed, but the property
Visible = False.
So far no problem: I do this useing the Form_Closing-event in which I typed:
e.Cancel = True
Me.Visibible = False
But: When I Close the MDIParent, it wont shut down the whole application
because of the fact that those MDIChilds cancel the closing!
I tryed to put work with a boolean which is set to true when MDIParent is
closed, and first evaluated in the MIDChild_Closing-event, but that doesn't
work either, because of the fact that the Closing-event of the MDIChilds are
fired before the Closing Event of the Parent...
Anybody got any idea how to do this? Maybe with the Closed-event? This event
comes after the Closing-event, but I can't find someting in ot to Cancel the
closing of the form.
I guess there must be a 'nicer' way to do this: Maybe by handling the click
on the "x", and when it is clicked not to close etc etc...
Hoping for your help and thanks a lot in advance,
Pieter Tag: How to make Combobox readonly Tag: 64217
AnchorStyles conversion
For a bitwise type like AnchorStyles the .NET runtime provides an easy way
to convert this to a string (like "Top, Left"), but is there an easy way to
convert it back again ? I've written my own method (see below) to do it but
it strikes me that there may be a much simpler way !
protected static AnchorStyles DeserializeAnchor(string a)
{
AnchorStyles retval = AnchorStyles.None;
if (a != "None")
{
if (a.IndexOf("Top") > -1) retval = retval | AnchorStyles.Top;
if (a.IndexOf("Bottom") > -1) retval = retval | AnchorStyles.Bottom;
if (a.IndexOf("Left") > -1) retval = retval | AnchorStyles.Left;
if (a.IndexOf("Right") > -1) retval = retval | AnchorStyles.Right;
}
return retval;
} Tag: How to make Combobox readonly Tag: 64215
add item to listbox [what am I doing wrong?]
Ok, here's the deal. I tried to do this and it didn't work:
[Child Form "Form2"]
Event OK (ByVal item as Object)
'I cast it as Object simply because that's the type of a Listbox Item.
Private Sub Button1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Raiseevent OK(Lisbox1.selecteditem)
End Sub
--------------------------------
[Parent Form "Form1"]
Private Sub Form2_OK(ByVal item as Object) Handles Form2.OK
Listbox.Items.add(item)
End Sub
the fresh new item on Form1's Listbox shows "System.Data.DataRowView"
what's going on?!?!?!?!
thanx for all previous replies!
ignacio
----------------------------------------------------------------------------
------
>Hi Ignacio,
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
You can bind a ListBox (via DataSource) to *any* object that implements the
IList interface. This includes Array or ArrayList. You just need to fill one
of these with suitable objects with a property for the string to display and
another for the data you need and set the DisplayMember and ValueMember
properties of the ListBox.
Cheers
Doug Forster
"Ignacio Martínez" <msnews@puturra.com> wrote in message
news:e3fiPPX0DHA.1708@TK2MSFTNGP12.phx.gbl...
> thanx for the 2nd response
> I had tried casting the [Object] Object from the child form to the parent
> form, but I only got "System.Listbox....something", instead of the text of
> the item I passed.
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
>
> it's pretty damn hard!
> I wish I only had to show the text for the item, but I really need the ID
to
> continue using that item for other purposes on the parent form.
> anyway, thanx
> I posted this message on other MS groups but I got no reply so far.
> nice weekend!
>
> <anonymous@discussions.microsoft.com> escribió en el mensaje
> news:014b01c3d16e$4acbe4f0$a601280a@phx.gbl...
>
> >-----Original Message-----
> >ok, so basically I can't manually set the valuemember of
> a listbox item
> >(webcontrols are more flexible in this cases...)
> >
> >thanx!!!!!!!!
> >
> >"TB" <tbrown92030@kaxy.NOSPAM.com> escribió en el mensaje
> >news:01a401c3d168$ed142430$a401280a@phx.gbl...
> >
> >>-----Original Message-----
> >>Hey group!
> >>first of all, happy new year to everyone.
> >>
> >>I have a small problem that I haven't worked out yet and
> >it's driving me a
> >>little crazy.
> >>I have two forms with a listbox control on each one.
> >>
> >>the child form passes the selecteditem to the parent
> form.
> >>but I want to pass the whole item (Value Member, Display
> >Member) and I have
> >>no clue on how to do this.
> >>what I could do was to pass just the text as a parameter
> >in an event on the
> >>child form.
> >>but that doesn't suit my needs.
> >>
> >>I can't use databindings, because I need to do this
> >manually.
> >>is there a way to add the whole item????
> >>
> >>thanx in advance!
> >>ignacio martínez
> >>buenos aires, argentina.
> >>
> >
> >Ignacio,
> >
> >Usually when I need to get more data for a selected item
> >in a listbox I will set each item's "Tag" property to an
> >object that contains what I need -- usually an instance of
> >whatever object I am working with. Given a selected item,
> >you just cast it's Tag value to what you expect and you're
> >off!
> >
> >-- TB
>
> Lo siento, Ignacio,
>
> I'm afraid I didn't read your post carefully enough the
> first time around. ListBox controls are different from
> the ListView controls that I'm more used to. The latter
> accept "smarter" items (where each can have a tag). A
> listbox does not.
>
> Ok, so let me see if I am understanding your problem.
> When the user selects an item in your child form's listbox
> you want to pass along both the display member string
> *and* value member string for that selected object up to
> the parent form.
>
> The value data is, of course, the "SelectedValue" for the
> listbox. There is no corresponding "SelectedDisplay", but
> you can use "SelectedItem" to get the object you
> originally added to the listbox, cast it to the right type
> of thing, and then access the property directly. You can
> also get the value member this way.
>
> But you're right -- the ListItem Web object allows the
> text and value members to be specified but the normal
> Forms Listbox just takes untyped Objects for its items and
> applies the same DisplayMember and ValueMember properties
> to all.
>
> -- TB
>
> Tag: How to make Combobox readonly Tag: 64214
IDesignerSerializationService
Hi,
I'm looking for examples, hints about a class which
implements IDesignerSerializationService (ns:
System.ComponentModel.Design.Serialization).
I'm trying to create a DesignerHost. The Copy and Paste
commands require that a IDesignerSerializationService
object is added to the Services of the ServiceContainer.
Without this it doesn't work. I can find any class which
implements this interface, strange!
Any help is appreciated.
Regards,
Fons Tag: How to make Combobox readonly Tag: 64212
Treeview Control
Hi,
Does someone know how to print the content of the Treeview
control ?
I'm afraid it's not so simple !
Thanks for your help Tag: How to make Combobox readonly Tag: 64208
Re: add item to listbox
Ok, here's the deal. I tried to do this and it didn't work:
[Child Form "Form2"]
Event OK (ByVal item as Object)
'I cast it as Object simply because that's the type of a Listbox Item.
Private Sub Button1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Raiseevent OK(Lisbox1.selecteditem)
End Sub
--------------------------------
[Parent Form "Form1"]
Private Sub Form2_OK(ByVal item as Object) Handles Form2.OK
Listbox.Items.add(item)
End Sub
the fresh new item on Form1's Listbox shows "System.Data.DataRowView"
what's going on?!?!?!?!
thanx for all previous replies!
ignacio
----------------------------------------------------------------------------
------
>Hi Ignacio,
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
You can bind a ListBox (via DataSource) to *any* object that implements the
IList interface. This includes Array or ArrayList. You just need to fill one
of these with suitable objects with a property for the string to display and
another for the data you need and set the DisplayMember and ValueMember
properties of the ListBox.
Cheers
Doug Forster
"Ignacio Martínez" <msnews@puturra.com> wrote in message
news:e3fiPPX0DHA.1708@TK2MSFTNGP12.phx.gbl...
> thanx for the 2nd response
> I had tried casting the [Object] Object from the child form to the parent
> form, but I only got "System.Listbox....something", instead of the text of
> the item I passed.
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
>
> it's pretty damn hard!
> I wish I only had to show the text for the item, but I really need the ID
to
> continue using that item for other purposes on the parent form.
> anyway, thanx
> I posted this message on other MS groups but I got no reply so far.
> nice weekend!
>
> <anonymous@discussions.microsoft.com> escribió en el mensaje
> news:014b01c3d16e$4acbe4f0$a601280a@phx.gbl...
>
> >-----Original Message-----
> >ok, so basically I can't manually set the valuemember of
> a listbox item
> >(webcontrols are more flexible in this cases...)
> >
> >thanx!!!!!!!!
> >
> >"TB" <tbrown92030@kaxy.NOSPAM.com> escribió en el mensaje
> >news:01a401c3d168$ed142430$a401280a@phx.gbl...
> >
> >>-----Original Message-----
> >>Hey group!
> >>first of all, happy new year to everyone.
> >>
> >>I have a small problem that I haven't worked out yet and
> >it's driving me a
> >>little crazy.
> >>I have two forms with a listbox control on each one.
> >>
> >>the child form passes the selecteditem to the parent
> form.
> >>but I want to pass the whole item (Value Member, Display
> >Member) and I have
> >>no clue on how to do this.
> >>what I could do was to pass just the text as a parameter
> >in an event on the
> >>child form.
> >>but that doesn't suit my needs.
> >>
> >>I can't use databindings, because I need to do this
> >manually.
> >>is there a way to add the whole item????
> >>
> >>thanx in advance!
> >>ignacio martínez
> >>buenos aires, argentina.
> >>
> >
> >Ignacio,
> >
> >Usually when I need to get more data for a selected item
> >in a listbox I will set each item's "Tag" property to an
> >object that contains what I need -- usually an instance of
> >whatever object I am working with. Given a selected item,
> >you just cast it's Tag value to what you expect and you're
> >off!
> >
> >-- TB
>
> Lo siento, Ignacio,
>
> I'm afraid I didn't read your post carefully enough the
> first time around. ListBox controls are different from
> the ListView controls that I'm more used to. The latter
> accept "smarter" items (where each can have a tag). A
> listbox does not.
>
> Ok, so let me see if I am understanding your problem.
> When the user selects an item in your child form's listbox
> you want to pass along both the display member string
> *and* value member string for that selected object up to
> the parent form.
>
> The value data is, of course, the "SelectedValue" for the
> listbox. There is no corresponding "SelectedDisplay", but
> you can use "SelectedItem" to get the object you
> originally added to the listbox, cast it to the right type
> of thing, and then access the property directly. You can
> also get the value member this way.
>
> But you're right -- the ListItem Web object allows the
> text and value members to be specified but the normal
> Forms Listbox just takes untyped Objects for its items and
> applies the same DisplayMember and ValueMember properties
> to all.
>
> -- TB
>
> Tag: How to make Combobox readonly Tag: 64204
DataGrid - Apply Color on a Perticular Row
Dear Frnds
How can i apply different Back Ground color on the perticualar DataGrid Row.
i want to apply the color not with respect to row no but with respect to
information caried by the dataRow attached with it.
Thanks Regards
Mubashar Ahmad Tag: How to make Combobox readonly Tag: 64202
HOW: Inherited forms and OnClick
Armin wrote on the 1st of Jan as a reply to Lorne Smith
"The designer creates the default procedure for events. Event procedures are
usually not Public Overridable. IMO, you should not change the signature in
the base class. If you want an overridable sub handling the Click, add an
Overridable OnButtonClick procedure called in the event handler of the base
class. In the derived class, override OnButtonClick".
Question 1:
Can anyone give an example (VB.NET if possible) on how to do that? I can't
find any. Not even the MSDE example for OnClick is about OnClick. I've got a
copule of books on Windows Forms (many of the good) and loads of online
articles, the authors avoid going into inherited forms, which is a pity,
since quite many questions in this discussion group seem to be about just
that.
Question 2:
I'm successfully using override, but now I get confused:
Lorne Smith writes: "when I put code in the sub, it was executed twice when
I ran the form. Now I realised this is because both the base form and the
inherited form are handling the event".
WHY does both the base form and the inherited form execute the event? I
thought override meant that the overriding method executes INSTEAD of the
overridden, not that both are executed. Why would I use the override keyword
if I want both to execute? But clearly Lorne is right in that both are
executed. I've considered that an oddity, but it is by-design then.
Kind Regards,
Kenneth Bohman Tag: How to make Combobox readonly Tag: 64191
Cannot change ListView first column text alignment
I try to change the text alignment of the first column of a list view, ColumnHeader.TextAlign but seems it doesn't work. The first column is always default to left alignment, which is HorizontalAlignment.Left. I even try to insert the column in design time and set the column alignment to either center or right, but still the text displayed is left-aligned. Is this a known issue or bug?
thanks,
Woon Kiat Tag: How to make Combobox readonly Tag: 64190
ShowDialog an MDI Child?
Hi,
I would like to know how I could do the above subject without getting any
errors?
Any help is very much appreciated.
Ramil Domingo
Developer Tag: How to make Combobox readonly Tag: 64189
Using a .dll to display a form
I have developed a .dll to display a form that controls a simple routine.
Oddly, you can't use
messagebox.show
unless you do one of two things:
either use an imports system.windows.forms
or
system.windows.forms.messagebox.show etc
Now this is strange, because the form inherits as below:
Inherits System.Windows.Forms.Form
Why is this and what other problems may I expect to encounter?
Thanks for any advice.
Bernie Yaeger Tag: How to make Combobox readonly Tag: 64187
Help! Microsoft.Win32.SystemEvents.WindowThreadProc eating CPU
I have a windows forms application that occasionally eats
100% of the hosts system's CPU indefintely. If I break
execution and selectively freeze threads, the culprit
seems to be the thread named ".NET System Events".
That thread is in a tight loop within
SystemEvents.WindowThreadProc. I don't understand the
disassembly, but it appears to be stuck completely within
that method as I step through it.
As I understand it, that thread is responsible for
calling events when system properties change. I have
hooked none of these events in my code, and like I said
the thread appears to be looping entirely within the
WindowThreadProc method.
This happens most often when coming back from a Fast User
Switch in XP or resuming from a suspended/hibernated
state.
What is going on?? How can I work around this? It's
noticed by customers and makes us look bad.
-Brian Tag: How to make Combobox readonly Tag: 64185
Bug in Windows Form Designer generated code (VS.NET 2003)
Every time I make a change affecting a toolbar (e.g. adding or removing
buttons), I loose the bitmap images at runtime. They are still displayed in
the designer, but when the application runs, the toolbar appears blank with
only separators visible. I determined that the problem is caused by the
wrong location of the toolbar.Buttons.AddRange function in the
auto-generated InitializeComponent function, which is placed before buttons
are initialized. If I manually move the AddRange function call after the
button initialization calls, it works fine, but the next time I make a
change, I have to do it again. This is really irritating. Is this a known
bug? Is there a fix for it? A better workaround? Thanks.
Alek Tag: How to make Combobox readonly Tag: 64175
How to test a dialog
Hi,
Cannot find the dialog preview button in the form design mode (VS.NET 2003,
C#). I mean the option similar to MFC's (VC++ 6.0), which lets you quickly
open the dialog you are currently designing, so you can see what it looks
like without the grid lines and using default properties. Is it available?
Am I missing something obvious?
Thanks,
Alek Tag: How to make Combobox readonly Tag: 64174
.NET Grid w/source & doc for only $49.99!!
Get GridQuick .NET control written entirely in Visual
Basic .NET 2003. A powerful grid that allows you to edit
cell contents and use different editors. You get the
source code, documentation and binary DLL file.
Have a look @
http://www.trycomed.com Tag: How to make Combobox readonly Tag: 64168
Possibility to route different kind of events to only one handler?
Hello,
Does anybody know the possibility of routing different kind of events (Which
has different EventArgs like Click and OnPaint for example) to only one
handler sub?
I'm creating a designer control to allow the end users to design a form.The
user can drag new controls into this design surface and after the design I
move those controls to a normal windows form..At this point, I want to get
notified any of the events that those new controls will generate..And I
don't have predefind event subs already in my code which I can link those
controls...
Is there any possibility for this?
Thanks in Advance...
Özden Tag: How to make Combobox readonly Tag: 64161
Client Operating Systems for .NET 2003
Hi, I am using window server 2003 to learn .NET 2003.
The .NET API is installed with the window server 2003.
* I guess .NET API is installed with XP.
* How about window 2000, 98, 95.
* How about Linux.
Please advice.Thanks.
Peter Tag: How to make Combobox readonly Tag: 64160
smtp.attachment lockes file when send exception.
Hi there,
Im having a bit of trouble with a logfile I use to put events in with a
streamwriter, after I have written in this file I want to send the file as a
mail with an attachment with smtp.
This all works fine until the smtp server goes off line or something goes
wrong.
I'm then catching the exception and try again later.
Now there is the problem. The log file I tried to send is now locked so the
streamwriter throws me an exception.
Why is it locked, or better, how do I get it unlocked?
Anyone?
Try
SmtpMail.SmtpServer = SmtpServer
SmtpMail.Send(MyMail)
Catch ex As Exception
' Now the file is
locked
Return ex.Message
End Try Tag: How to make Combobox readonly Tag: 64159
Application Losing Focus when running from exe
Hi,
I have a winforms app which, when run from the VS.NET
IDE, puts input focus on the startform as one would
expect.
However, when I run the exe directly, the main window
does not retain focus and I have to manually click on the
window to give focus to it.
Any explanations would be greatly appreciated.
Thanks Tag: How to make Combobox readonly Tag: 64158
RE: add item to listbox
Ok, here's the deal. I tried to do this and it didn't work:
[Child Form "Form2"]
Event OK (ByVal item as Object)
'I cast it as Object simply because that's the type of a Listbox Item.
Private Sub Button1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Raiseevent OK(Lisbox1.selecteditem)
End Sub
--------------------------------
[Parent Form "Form1"]
Private Sub Form2_OK(ByVal item as Object) Handles Form2.OK
Listbox.Items.add(item)
End Sub
the fresh new item on Form1's Listbox shows "System.Data.DataRowView"
what's going on?!?!?!?!
thanx for all previous replies!
ignacio
----------------------------------------------------------------------------
------
>Hi Ignacio,
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
You can bind a ListBox (via DataSource) to *any* object that implements the
IList interface. This includes Array or ArrayList. You just need to fill one
of these with suitable objects with a property for the string to display and
another for the data you need and set the DisplayMember and ValueMember
properties of the ListBox.
Cheers
Doug Forster
"Ignacio Martínez" <msnews@puturra.com> wrote in message
news:e3fiPPX0DHA.1708@TK2MSFTNGP12.phx.gbl...
> thanx for the 2nd response
> I had tried casting the [Object] Object from the child form to the parent
> form, but I only got "System.Listbox....something", instead of the text of
> the item I passed.
> I think it has something to do with not giving valuemember and
displaymember
> values (what values could I give? it's not bound)
>
> it's pretty damn hard!
> I wish I only had to show the text for the item, but I really need the ID
to
> continue using that item for other purposes on the parent form.
> anyway, thanx
> I posted this message on other MS groups but I got no reply so far.
> nice weekend!
>
> <anonymous@discussions.microsoft.com> escribió en el mensaje
> news:014b01c3d16e$4acbe4f0$a601280a@phx.gbl...
>
> >-----Original Message-----
> >ok, so basically I can't manually set the valuemember of
> a listbox item
> >(webcontrols are more flexible in this cases...)
> >
> >thanx!!!!!!!!
> >
> >"TB" <tbrown92030@kaxy.NOSPAM.com> escribió en el mensaje
> >news:01a401c3d168$ed142430$a401280a@phx.gbl...
> >
> >>-----Original Message-----
> >>Hey group!
> >>first of all, happy new year to everyone.
> >>
> >>I have a small problem that I haven't worked out yet and
> >it's driving me a
> >>little crazy.
> >>I have two forms with a listbox control on each one.
> >>
> >>the child form passes the selecteditem to the parent
> form.
> >>but I want to pass the whole item (Value Member, Display
> >Member) and I have
> >>no clue on how to do this.
> >>what I could do was to pass just the text as a parameter
> >in an event on the
> >>child form.
> >>but that doesn't suit my needs.
> >>
> >>I can't use databindings, because I need to do this
> >manually.
> >>is there a way to add the whole item????
> >>
> >>thanx in advance!
> >>ignacio martínez
> >>buenos aires, argentina.
> >>
> >
> >Ignacio,
> >
> >Usually when I need to get more data for a selected item
> >in a listbox I will set each item's "Tag" property to an
> >object that contains what I need -- usually an instance of
> >whatever object I am working with. Given a selected item,
> >you just cast it's Tag value to what you expect and you're
> >off!
> >
> >-- TB
>
> Lo siento, Ignacio,
>
> I'm afraid I didn't read your post carefully enough the
> first time around. ListBox controls are different from
> the ListView controls that I'm more used to. The latter
> accept "smarter" items (where each can have a tag). A
> listbox does not.
>
> Ok, so let me see if I am understanding your problem.
> When the user selects an item in your child form's listbox
> you want to pass along both the display member string
> *and* value member string for that selected object up to
> the parent form.
>
> The value data is, of course, the "SelectedValue" for the
> listbox. There is no corresponding "SelectedDisplay", but
> you can use "SelectedItem" to get the object you
> originally added to the listbox, cast it to the right type
> of thing, and then access the property directly. You can
> also get the value member this way.
>
> But you're right -- the ListItem Web object allows the
> text and value members to be specified but the normal
> Forms Listbox just takes untyped Objects for its items and
> applies the same DisplayMember and ValueMember properties
> to all.
>
> -- TB
>
> Tag: How to make Combobox readonly Tag: 64157
How to (easily) change the width of a single column in a DataGrid [VB.NET]
I've run into a few posts on this, some with answers pointing to FAQs
(like http://www.syncfusion.com/faq/winforms/search/754.asp), but I
figured I'd go ahead and share the code I'm using. Basically, you
need to set up a for loop through every column in your dataset and
create a default action rigging up a DataGridColumnStyle for each.
Then look for the cols that need special treatment and knock yourself
out.
You might insert a "case else" below and move the mappingname and
headertext there to have a mutually exclusive default handler.
' Assumes you've got...
' Public dsTime As DataSet
' Public grdTime as DataGrid
Dim myGridTableStyle As DataGridTableStyle = New DataGridTableStyle
Dim TextCol As DataGridColumnStyle
Dim dcTemp As DataColumn
myGridTableStyle.MappingName = Me.dsTime.Tables(0).TableName
For Each dcTemp In Me.dsTime.Tables(0).Columns
TextCol = New DataGridTextBoxColumn
' I want my "description" column to be wider than the rest
' Select Case is overkill for one col, but is an easy place
' to expand to catch other columns
Select Case dcTemp.ColumnName
case "description"
TextCol.Width = 250
End Select
' Everything else gets added with defaults, though you
' need to provide a name for the column to show up in
' the DataGrid.
' Seems to keep the default validators and everything
' by simply doing the below
TextCol.MappingName = dcTemp.ColumnName
TextCol.HeaderText = dcTemp.ColumnName
myGridTableStyle.GridColumnStyles.Add(TextCol)
Next
' add formatted tablestyle to the datagrid
Me.grdTime.TableStyles.Add(myGridTableStyle)
' bind the datagrid
Me.grdTime.DataSource = Me.dsTime.Tables(0)
Ha, and if you search Google for something with "single" in it, like,
say, [datagrid "single column"], prepare for some Google Ads to
eHarmony.com & gotoCupid.com (though we all know GOTOs are Bad
Things), etc. Tag: How to make Combobox readonly Tag: 64156
Control Focus issues
Hello,
A form with 3 textboxes and a button and the code
below :
Private Sub TextBox2_Enter
fred()
end sub
Private Sub fred()
TextBox3.focus
End
Private Sub TextBox3_enter
console.writeline("Entering")
End
Private Sub TextBox3_Leave
console.writeline("Leaving")
end
Private Sub Button1_Click
TextBox2.focus
End
The intent here is to start with the focus in TextBox1
(no events), click the button. The button changes focus
to TextBox2. The Enter event calls a routine that also
shifts focus, this time to TextBox3.
I would expect the output to be:
Entering
Instead I am getting
Entering
Leaving
Entering
This seems wrong and is causing some issues. In
practice, tabbing to 'TextBox2' takes the place of the
button click, but the end result is the same, a Leave
event at the "wrong" time.
mklapp Tag: How to make Combobox readonly Tag: 64154
Combo box in DataGrid
The MSDN tells it would be possible to create own
DataGridColumnStyles and
there also exists a DataGrisComboBox in
Microsoft.ClrAdmin. It can be bound
to the GridColumnStyles Collection but just shows a
DataGridTextBox. Who already tried this successfully? Tag: How to make Combobox readonly Tag: 64153
How do you debug a Designer Error from Inherited forms
I am getting an error in the Designer when trying inherit
a form.
Value cannot be null: Parameter Name dataSource
now I do not use the Name dataSource in any of the
inherited code so I am assuming that this is in the VS
Designer code somewhere.
The original base form comes up in the designer just fine.
If I Ignore the designer and compile the new Inherited
form it compiles and runs just fine.
Is there a way of debugging what the designer is doing
when it attempts to load the inherited form so I can see
what is giving the designer grief. Tag: How to make Combobox readonly Tag: 64152
combobox FindString
Hello, help me please with combobox FindString,
I want to perform a search for an second substring entry in the combobox
items collection. I use the FindString with specifying a starting index
within the ComboBox. I have tried the following but none seem to work:
cmbBox.FindString(strWhat, cmbBox.FindString(strWhat)) - :( don't work
For example:
if Items count is 1 - I have only one item in the items collection,
cmbBox.FindString(strWhat) return 0 - this only one item starts with strWhat
With FindString(strWhat, 0) i receive ArgumentOutOfRangeException error...
Why, if error condition is: "The startIndex is greater than the last index
in the collection."????
How I can do this? Tag: How to make Combobox readonly Tag: 64151
The operation could not be completed
Hi
All was fine and suddenly from the moment
if I click on my Crystal Report file in
solution explore the message
The operation could not be completed
is displayed.
Can somebody help me what is it?
Thanks
Konrad Tag: How to make Combobox readonly Tag: 64149
Propertygrid context menu
Hi
In the VS .Net the Propertygrid has a context menu
with 'Reset' and 'Description' menu points.
I want to have this context menu also for runtime
PropertyGrids.
How can this be done?
Sincerely
orbit Tag: How to make Combobox readonly Tag: 64144
Saving Rich Text to Database
How do i save text in a RichTextBox Control to a SQL
server Database and retrive it back without losing its
formatting. Tag: How to make Combobox readonly Tag: 64142
WinForms UserControl problem at VS.NET design view
Hi,
I'm working on a Win form application which is being developed in VB.Net. I
have created few User Controls quite some time back and implemented them
successfully. Now the problem is, I'm not able to use UserControls using my
VS.NET IDE. When I tried to drag and place the user controls on WinForm
(from Toolbox), it shows an error saying "An exception occurred while trying
to create an instance of Classname.UserControlName. The exception was
'Value cannot be null. Parameter name:path'". And another strange problem
is when I tried to open my existing solution, the controls are missing and
an error is shown like "The Variable 'UserControlName' is either undeclared
or was never assigned.
Could some one please help on this ASAP? Your help is muchhhly appriciated
as we are closed to the deadline.
Thanks in advance,
Kiran Tag: How to make Combobox readonly Tag: 64140
about email questions
in windows form, I can use the System.Web.Mail
how can I send the email to the client??
any reference site? Tag: How to make Combobox readonly Tag: 64139
SQLDataAdapter SP Generation
Hi,
I have created an SQLDataAdapter component on my vb.net winform project and
stepped through the wizard. In my SQL Database I have a table with fields
using user defined data types and not the base data types. The problem is
that when the stored procedure gets created by the adapter the parameter's
data types did not follow the data type of the table I used in the wizard.
Is there any solution on how I could use my user defined data types in my
SP, autogenerated by the adapter, w/o actually modifying the SP after
running the wizard?
Appreciate any help.
Thanks.
Ramil Domingo
Developer Tag: How to make Combobox readonly Tag: 64136
Hi,
I'm populating a combobox from a database, but would like to prevent users
to edit in it.
Can't find any readonly property. Anyone know how to do this ?
Totto wrote:
> Hi,
> I'm populating a combobox from a database, but would like to prevent
> users to edit in it.
> Can't find any readonly property. Anyone know how to do this ?
Set the DropDownStyle property to the value ComboBoxStyle.DropDownList
Re: How to make Combobox readonly by hirf-spam-me-here
hirf-spam-me-here
Thu Jan 08 12:14:31 CST 2004
* "Totto" <taa@norcon.no> scripsit:
> I'm populating a combobox from a database, but would like to prevent users
> to edit in it.
> Can't find any readonly property. Anyone know how to do this ?
Set the 'DropDownStyle' property to 'DropDownList'.