|
You need to set it manually, which means you need to set it AFTER you show the form. Otherwise, the framework moves it on you. So, you need to get the position of the parent form top and left, and add 218,28 to it
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Right,got that, but how do i refrence that to the parent form?
would it help if i better explain?
i've got my parent form set to load at the same point based on where you closed it. the problem i'm having is trying to refrence the location of 218,28 of the parent form, since the form isn't allways going to be located at 0,0, it maybe located on screen two or three of a multi-screen system, and the user has to move across to system.drawing.point(218,28) just to reach the new form... not sure, maybe i'm just missing your point...no punn intended
pretty much i've tried everthing i can think of(yes, very limited) and the most i've found to even come close was this.PointToClient. this was nice, it moved the new form in relation to the parent form, but the problem is it often disappears based on the parent form...basically it didn't work correctly ever.
|
|
|
|
|
The parent form has a Left property and a Top property. At least, I think it does I'd take those, and add the values to that. And, if you set the owner of the child form to be the parent, the code can go in the child form, it can move itself when it is first shown, and check it's owners position as a starting point.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Actually, that was one of the things that i didn't think of at the time of writing that last post, i actually had just testing that before you replied... having some difficulty as i having to make sure everything is in its proper place...oh syntax.....
i'll post my results in a few...hopefully!
|
|
|
|
|
hey, yah, as simple as it was, that was the solution.... why is it easier to think of the hard(or complicated) solutions before thinking of the simple ones?
must just be me....
|
|
|
|
|
Hi all.
I would like to have few files in my code, like WAV file and ICO file and i
also want to use them in the program but i dont want to have them as an extra
files inside my directory (because then things can go wrong..)
how can "attach" them in DLL or in the EXE itself ?
thanks,
Ran.
R.Z
|
|
|
|
|
You'll have to embed these as resources.
You can find out more here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow
so quick.
i will check it out.
R.Z
|
|
|
|
|
Hi all,
Can someone please point me in the direction of how I would go about being able to set certain items in a ComboBox to Bold.
Basically I want my Combo to look like this when i drop it down
Group1 <bold>
A
B
C
Group 2 <bold>
D
E
F
Cheers
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders
|
|
|
|
|
The only way you're going to be able to do that is if you ownerdraw the item list. The ComboBox doesn't support doing this on its own.
You can find an example of ownerdrawing a ComboBox here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave,
Thank you for that link. It was perfect. I am now trying to figure out how to get the default font a Combobox would use, so I can reuse that, and just change the setting to Bold for certain items.
Cheers
Jubjub
"If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)
|
|
|
|
|
you might also want to look at this control.
http://www.codeproject.com/cs/miscctrl/ImageComboBoxControl.asp
|
|
|
|
|
That's a pretty good one too. How did I miss that?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
What will be the diff if I use casting of int and Convert.Int32().
|
|
|
|
|
You can only cast to an int if the datatype is similar, like a long or a double. You also use that syntax to unbox an int, for an example if you store then in an ArrayList.
Converting to an int can be done from more data types, one common example is a string.
You can also use int.Parse() to convert from a string. That is similar to Convert.ToInt32. One difference, though, is that Convert.ToInt32 will accept an empty string and return a zero value, while int.Parse won't.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for ur explanation ...
Performance wise which will be the best option int or Convert.Int32?
|
|
|
|
|
That depends on what you are converting. For an example, the implementation of Convert.ToInt32(Int16) looks like this:
public static int ToInt32(Int16 value) {<br />
return (int)value;<br />
}
So, the only difference from using the cast directly is the method call. And if the compiler is clever enough, it will never even do the method call, but simply use the code from the method inline, so there will be no difference at all in the final executable code.
However, one thing is certain. The call to Convert.Int32 is never faster than a direct cast.
---
b { font-weight: normal; }
|
|
|
|
|
Hi all,
I’m using the comboBox to show values to select one of them
Those values are from a database, where there are Ids and values.
So, the DisplayMember is the value and the ValueMember is the ID.
the first worked but the second refuses to work at all. And I don’t know why..?
<br />
comboBox1.DataSource = dataSet3.Tables["DESIGNATION_EDIT"];<br />
comboBox1.ValueMember = "D_ID";<br />
comboBox1.DisplayMember = "D_TYPE";<br />
then i need to use it here where the problem appears
<br />
newrow[11]=comboBox1.ValueMember;<br />
table.Rows.Add(newrow);<br />
if any body could help.., I’ll be grateful.
|
|
|
|
|
moonangel_bio wrote: hen i need to use it here where the problem appears
newrow[11]=comboBox1.ValueMember;
table.Rows.Add(newrow);
what actually happens ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
when i try to add a new record using my application, this messeage appears:
An unhandled exception of type 'System.ArgumentException' occurred in system.data.dll
Additional information: System.FormatException: Input string was not in a correct format.
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Convert.ToInt32(String value, IFormatProvider provider)
at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
at System.Convert.ToInt32(Object value)
at System.Data.Common.Int32Storage.Set(Int32 record, Object value)
at System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store <d_id> in S_DESIGNATION_ID Column. Expected type is Int32.
where D_ID is the ValueMember of the comboBox and i need it to be stored in S_DESIGNATION_ID in the data base
|
|
|
|
|
Well, now that you're told us the problem, it's obvious. A string that's coming in is not a number, and it needs to be.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello Friends,
I am new here. For our senior project at school, we are using .Net C#. And we want to compile and deploy C Code in C3. How can we accomplish this?
I surely be so glad to receive your help.
Take it easy, guys!
|
|
|
|
|
You can call functions written in C compiled to a .dll from .NET by providing what is effectively the function prototype and marking it with a DllImportAttribute . More information can be found here[^].
|
|
|
|
|
Your other option is to wrap it in a C++/CLI project, so you can call it using .NET.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|