|
i am using some code to adjust the heights of the controls in the form_resize event i don't know eventhough write the code for adjusting height one control(listbox) its not at all properly adjusted please help me.
thanks.
|
|
|
|
|
The problem is with line 27 of your code. Character 8.
In other words, we can't possibly help you if you don't show us the code. To adjust the size of a control, you just set it's Width/Height/Left/Right properties. But if the control is also set to dock to a side, or to align with certain edges, that could override your code.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
please don't get irritated of my lenghty thread.
private void Form1_Resize(object sender, EventArgs e)
{
if (this.Height > 576)
{
treeView1.Height =(this.Height-576)/2 +313; listBox1.top=treeview.bottom+27;
listBox1.Height = 134 + (this.Height - 576) / 2;
}
}
here the numbers 576,313,134 are the actual heights af the control before resize and i set forms minheight to 576.like this i am adjusting the heights of the other controls in my form (tabcontrol,groupboxs,buttons,labels,richtextbox controls etc) i wrote a few lines because all those lines of adjusting the controls leads to 100+lines
in my code all the controls are properly resized except the listbox control that's why i included that part and nowhere i used listbox property related code in the code i wrote other than the two lines which mensioned above.
|
|
|
|
|
Have you set a break point ? If this code is being called, it seem a little convoluted, perhaps it's doing what you ask ? Have you looked into setting the Anchor property on your controls so they resize themselves to what you want ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I think you can save yourself much work by appropriately using the Anchor and Dock properties of your controls, so they automatically resize with your form.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Or maybe the dock property of this control is the problem????
|
|
|
|
|
Maybe. Hard to say without knowing the whole code and in which way the resizing of the ListBox isn't as expected i.e. it gets to large, small or maybe doesn't resize at all.
Point of my posting was/is that you can save yourself a lot of time and work by appropriately using Anchor and Dock properties instead of complicated custom resizing.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
it could be that you have to use the Refresh method afterwards to redraw the control...
|
|
|
|
|
kalaveer wrote: adjusting height one control(listbox) its not at all properly adjusted
I'm not sure, but you may be talking about IntegralHeight . If it is set to true , which is the default, the ListBox will only resize in vertical "chunks" equal to the size of a row.
If you set that property to false , you can set the height to any value.
Share and enjoy.
Sean
|
|
|
|
|
Hi Dear Respected Programmers
I am working in class and I want to use combobox from Form1. Kindly send me little method about said problem.
Thank you very much in Advance
|
|
|
|
|
I don't get what you want. The combobox is on form1 and you want to interact with it ? To do this, you need to use a delegate, or pass a reference to the Form1 instance to whatever class wants to see the contents of the combo box. Either way, I would never expose the entire control, I'd add a property that sets or gets the bits you need access to.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
dear sear
i want to creat web sit by using .net2005 but i don`t know how to creat frame to the pag so i want you to helpe me to creat frame by using C#.net 2005 and i will be happy to your helpes
ashraf hakiem
ashraf_23_2005@yahoo.com
|
|
|
|
|
You probably meant to ask in the ASP.NET forum ? What do you mean by a frame ? So there's a menu on one side for example, and the main page on the other ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
thank you to your helpe but the probleme is when we want to creat frame by using asp.net2003 we do thate
in the soluation explorer and then Right click the solution and then choos add and then add new item and then choose framesit
but how to do that by using asp.net 2005
|
|
|
|
|
I have created a Class Library and within the class library I have a Windows Form. I compiled this class library and got the dll. This dll is now embedded on a HTML page using:
<object id="ndcObj" classid="http://nh-rajen/ntest/NDCDemo.dll#NDCDemo.NDCDraw" height="356" width="367">
Now I need to call a method within this dll from javascript within the page, lets say I do it onClick of a button on the page as:
function ChangeText()
{
ndcObj.setText('Test Text');
}
This however does not work and I get the error that the object has no such defined properties or methods. How do I expose my method such that I can call it from outside of the dll. The current method definition for setText is:
public static void setText(string txtValue)
{
this.textBox1.Text = txtValue;
}
Please help me out..
Thanks in advance,
Cheers,
Rajen
|
|
|
|
|
I didn't know javascript could talk to a .NET dll at all. So, you intend to distribute this dll to your end users machines ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes. The javascript is able to access public attributes. However when it cannot access my public methods. I think there should be some trick to expose the methods inside the dll so that javascript is able to call them. Not sure how its done though..
|
|
|
|
|
Hi
i open a file with FileStream and read byts.
Using straemReader i also read some char from the file.
i want to create a file from reading character .
But "illegal char in path" exveption occure.
while in the text there is no illegal char.
it display
text smoothly
text is "schedule"
i concat this string with c:\
now become "c:\schedule"
i use this mehtod to ctreat file
System.IO.FileStream f;
f=System.IO.File.Create(stFileName);
f.Close();
i am trying to solve this problem last 2 days.But can't
plz tell me solution
Parshant
|
|
|
|
|
If you're specifying the \ character in a constant string, you need to do one of these:
@"c:\schedule"
or
"c:\\schedule"
Otherwise, \ is used to define various special characters.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i done as u directed but consistent
|
|
|
|
|
Perhaps if you posted the code which creates strFilename ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a requirement where I can drag-drop an item from ListBox to a Day on a month calendar. When a item is dropped on a Month Calendar a DragDrop event is raised. The event provides a DragEventArgs as parameter. This parameter provides X, Y screen co-ordinates. Can this co-ordinates be used to find out which day in the Month Calendar is the item being dropped?
Is there a way in which I can know which Day in the MonthCalendar is the Item being dropped?
Thanks in advance
Kaushik
|
|
|
|
|
hi, i design a windows application with csharp. I want allow to users high light a part of the picturebox with drag mouse on it.
How can i do?
Thanx
|
|
|
|
|
One day, I intend to write a picture box derived control that does all the things that people try to do with it now, but it just can't do. Until I do, you need to ditch the picture box, draw the image in your own Paint handler, and draw your highlight over the top of it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Dear Christian Graus , if I use draw image in own Paint handler , back color of darawed image cover the picture box and i can not see part of picture box that is behind the drawed image.i want behind of drawed image be visible as highlight.
please help
|
|
|
|