|
Iam using two forms in a windows appln. How can I access the control of the second form from the first form.
Thank you
|
|
|
|
|
Take a look HERE
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi,
I am having an issue with labels where on a long label, with a small font size, words towards the end of the label are getting a more compact spacing between letters as compared to words at the start of the label.
Issue can be avoided with larger font sizes, but this isn't an appropriate work around.
I've chucked up a screenshot:
http://i24.tinypic.com/2a77y1l.jpg
Thanks in advance
Bryan
|
|
|
|
|
Use the AutoEllipsis property of the lable.. set it to true.
------------------------------------------------------------------
Life would have been much easier if I had the source-code!!
|
|
|
|
|
|
Hello
I am trying to use escape characters to display messages back to a scrollable TextBox in a windows forms application. Here is a code snippet:
Message.Text = "This Project containts a total of " + TotalDocs.ToString() + " documents.\r" +
TempPrintDocsCount.ToString() + " Documents have been copied to: c:\\Temp\\TempPrintDocs\\Projects.\r" +
UpdatedDocsCount.ToString() + " Documents have been updated.";
I have set "AcceptsTab" & "AcceptsReturn" to True for the TextBox. The only escape character that seems to work is the tab \t but none of the line feed or carriage return work?? Is this some bug with the TextBox in Windows Forms? Does anyone have a solution to this? Any help would be much appreciated!
Thanks!
Sidhusir
|
|
|
|
|
AFAIK:
1. a TextBox reacts to Environment.NewLine which on Windows typically equals "\r\n".
2. AcceptsTab and AcceptsReturn (and many others) influence the reaction to keyboard
input, not text assignment.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you very much!
|
|
|
|
|
Figured it out, being a newbie, made the mistake of doing \n\r when it should have been \r\n!
|
|
|
|
|
The font object is used to set a font programmatically, but how do I change the font type or size in response to a button click event?
How does one populate a list box with the fonts a user has on his cpu?
Thanks,
Boyd
G. B. Swartz
|
|
|
|
|
hi
1. myLabel.Font=new Font("Arial", 12);
2. InstalledFontCollection Class will give the names, which you then add to myListBox.Items
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks Luc, but I want the parameters to be variables as other controls are changing the name, size and type.
MyLabel1.Font = (Font)fc.ConvertFrom(mystring);
This will change the name but I can't get the size to work.
I will look up the other class.
boyd
|
|
|
|
|
when I wrote new Font("Arial", 12) as an example, I assumed you understand
one can also provide variables rather than literal font names and font sizes...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Yes,
string mystring = "Tahoma";
string oldstring;
oldstring = label1.Font.Name.ToString();
float mysize =16;
label1.Font = new Font(mystring,mysize);
This works, I had been using int and not float.
I got the installed fonts working also.
Thanks again,
Boyd
|
|
|
|
|
I m using vb.net 2005. I dont want to hard code my connectionstring I want o be able to pass the Database name and teh server name to my connectionstring
any vb.net code will be appreciated.
How do i serach a domain or a network for the servers
t.aransiola
|
|
|
|
|
Normally you would do this in the connection strings section in your config file. That's why its there.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi!
i have 2 forms on my application and 1 called form1 and the another form2 and i want to close form1 by click Button on form2.
how can i do it?
thanks!:->
|
|
|
|
|
In VS 2005, Assuming that you have opened form2 like this:
Dim form2 As New Form2<br />
form2.Show()
Then you can close form 1 like this from form 2:
Form1.Close()
The only problem is that if you do that, Form 2 will close as well (since form 1 created the form 2 instance). So you would have to have another form or Main routine to control all the form open and closes.
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
hi guys am new in this Subject, how do i make my forms to look like Vista?
pleaes point an Article or Tutorial in vb.net
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswamb wrote: how do i make my forms to look like Vista?
Run your application on Vista. That'll do it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: Run your application on Vista. That'll do it.
Should one assume they developed Vista based on the characteristics of his machine
and the requirements of his app?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Only can be done by running Vista. If you want to have Vista-like forms in XP/2000, it cannot really be done.
"I really like comments where I don't have to answer stupid questions" - stfx
|
|
|
|
|
Thanks man for your Reply, i understand
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I am sure there are probably some tricks out there to simulate it though.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
Upon clicking a treeview node, the following events fire (correct me if I am mistaken) - Click and AfterSelect.
In the Click event I want to perform a test and optionally prevent the node that was clicked upon from being selected. I think I have to prevent the execution flow from reaching AfterSelect? Is there a way of "cancelling" the click event or otherwise achieving this?
I do have a work around - a form level boolean variable that I set True if I want to cancel - in AfterSelect if this is set True then it exits the AfterSelect event handler function. But this seems at best a kludge.
Many thanks in advance!
- Anthony
|
|
|
|