|
Hi all,
The clients didn't mention it and I forgot to ask. So everyone get out the wet noodles and beat me with them. Okay, now that we've properly assigned blame I'm hoping someone can help me.
All the forms in my app have been designed at 1280x768. I need the application to also look right and fit on the screen at 800x600. Please tell me there's some quick solution? I tried using the me.scale property on the form and all its objects but that requires that I do something either with docking or anchoring. Is there a quick something out there that will check the resolution of the computer and resize the stuff on my forms and the forms themselves.
And yes, I know all about people using a lower resolution because they want things bigger and all. But that's just not an option here. And the real reason we need it is because our program will be used in 3d world countries where my client's convinced they may only have the smaller resolution available to them.
Help? Thanks in advance for any help you can give.
Denise "Hypermommy" Duggan
|
|
|
|
|
If the app wasn't designed for runtime scaling from the beginning, I doubt there is any fast & easy way to change it: it should be re-designed.
If that's not an option, then...
One solution is to implement a loop on all the controls upon form loading and resize and reposition them. Drawback: the resized/repositioned layout will not be as neat as the original.
Another solution, if your requirements are for two fixed resolutions, would be to manually design the form for both (in order to have a neat and good looking interface in both cases), leave it in one of the two layouts, and then switch to the second layout at runtime depending on the screen's resolution. Drawback: this would be a mess to manage for modifications.
I like the 1st solution best. Hope this gives you some ideas.
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
I doubt there is anything readily available that combines those two.
My.Computer.Screen.WorkingArea will give you the available desktop space.
Next you'll probably have to loop through all controls, and scale them.
It might be quicker to just anchor all your controls, and use me.scale
My advice is free, and you may get what you paid for.
|
|
|
|
|
There is no easy quick fix for this. You application should have been designed with layout containers, docking, and anchoring from the start, even if the form isn't resizable. If it was, your solution wuold have been easy and quick.
You have no choice but to re-engineer the layout of your forms, by hand.
|
|
|
|
|
Where can I find out more about layout containers... starting with what they are, please? Thanks.
Denise "Hypermommy" Duggan
|
|
|
|
|
They're all in the ToolBox, under the Containers tab. FlowLayoutPanel, Panel, TableLayoutPanel, GroupBox, SplitContainer, ... All you have to do is look up each control at MSDN[^].
|
|
|
|
|
I have a database "Employee_Master", there I have a table emp_master
and I have another database "Purchase_Master", there i have a table mpr_master
So how to have a select query for this type of requirements?[sql server 2008]
select mpr_master.mpr_no,mpr_master.emp_id,emp_master.emp_name from mpr_master,emp_master where mpr_master.emp_id=emp_master.emp_id
Thanks
|
|
|
|
|
So we're talking SQL here not VB, but okay.
SELECT T0.*
FROM Employee_Master.dbo.emp_master T0
INNER JOIN Purchase_Master.dbo.mpr_master T1 ON T0.emp_id = T1.emp_ID
or
SELECT T0.*
FROM Employee_Master.dbo.emp_master T0
WHERE T0.emp_id IN (SELECT T1.emp_id FROM Purchase_Master.dbo.mpr_master)
etc.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Will there always be a record in purchases that corresponds to each employee record? If not you may want to use a LEFT OUTER JOIN (same syntax as above I believe but replace INNER JOIN with LEFT OUTER JOIN).
If you have an employee record that has no purchases records and you use an inner join, that employee record won't show up because there's no purchases to go with it. If you use an outer join the employee record will show up with a null in the purchases field(s).
Hope that helps.
Denise "Hypermommy" Duggan
|
|
|
|
|
Hi to Everybody,
I'm using a MDIContainer with VB2005
From this Form I open a MDIChild1
From this one I need to open a new MDIChild2 Form as MDIChild Form, but I need to show it as modal because I need to do some operation only after that the MDIChild2 is closed
I try to better explain:
I Wrote:
Dim childForm As New frmMain
childForm.Text = GESTIONE_PROGETTO
childForm.MdiParent = MDIParent1
childForm.Show
...
updateGrid()
It works fine, but the Procedure UpdateGrid run even if the childForm is still open...
I Wrote:
frmMain.ShowDialog()
updateGrid()
It works fine, but the frmMain is not contained into the first form
I Wrote:
Dim childForm As New frmMain
childForm.Text = GESTIONE_PROGETTO
childForm.MdiParent = MDIParent1
childForm.ShowDialog()
updateGrid()
It doesn't work because "Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before calling showDialog."
Do you have some suggestions???
Best regards
Leonardo
|
|
|
|
|
If it's Modal - why would you expect to be able to contain it in your MDIParent?
There are two solutions to this. The first (best) is to subscribe to the FormClosed event of the child, and call UpdateGrid from the event handler.
The other is to force the dialog to be constrained to the client area of the parent. This is a little tricky but possible. I wrote on article on this some time ago. I need to revisit it to clean it up a little, and it's in C#, but it should be obvious enough how I've done it so you can translate. Link[^].
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
leozampa74 wrote: From this one I need to open a new MDIChild2 Form as MDIChild Form, but I need to show it as modal
MDI Child forms cannot be shown modal.
I think you need to rethink your design. I'm wondering why everyone thinks that Multiple DOCUMENT Interface means that they can show MDIChild forms as dialogs. A dialog does not edit a document, so what's the point?
|
|
|
|
|
I need 2 MDIChild becasuse the same ChildForm need to access to the same MDIParent Menu.
At the same time i need that the first child Form wait until the second child Form is closed.
For this reason i need MDI and Modal too.
Probably you're right, I need to rethink my design.
For the moment I'm trying to add some instructions to the formClosingevent on the second Form, but I think is not so good.
I'm not a visual basic expert, i use it only 100hours per year. Could you advice me?
|
|
|
|
|
You're missing point. Multiple DOCUMENT Interface means that each MdiChild form is designed to edit a particular document or set of data, completely independant of other MDIChild forms.
If you have one MDIChild waiting on another MDIChild, you've got a serious design flaw.
|
|
|
|
|
Hi all,
I am very new to VB so please forgive my basic questions.
I have a webcontrol on a form that I use to populate fields on a webpage. The web page has an add another line function that in turn adds more fields to the form.
So basically I need to check if a field exists before setting the value.
WebBrowser2.Document.GetElementsByTagName("input").Item(22).SetAttribute("Value", Value) Works, but as I stated I need to check if item(22) exists before setting it's value.
Thanks in advance for your help it really is appreciated.
Paul.
|
|
|
|
|
What happens when you try to retrieve the value from an item that does not exist?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Following error:
System.ArgumentOutOfRangeException was unhandled
Message="Value of '25' is not valid for 'index'. 'index' should be between 0 and 20. Parameter name: index"
Thanks for your response... much appreciated.
Paul.
|
|
|
|
|
So there is an index with a certain size at any time.
Before you try to set the value of an element, just check that the index number of that element is smaller than the length of the array.
In pseudo code:
If the_index_number_of_the_item_you_want_to_check >= items.Count Then
'write to the item or not (I am not sure what you are trying to do)
End If
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi Thanks again,
I think I understand, but please forgive my newbieness.
I dont know how to reference this index, I've tried several ways, but I feel like i'm shooting in the dark.
If WebBrowser2.Document.GetElementsByTagName("input").item(22) >= 1 Gives the following error:
I get an error value is not a member of 'System.Windows.Forms.HtmlElement'
What I thought I could do which also fails is:
If Exists WebBrowser2.Document.GetElementsByTagName("input").item(22) then ..... else ......
Paul.
|
|
|
|
|
WebBrowser2.Document.GetElementsByTagName("input").Count will give you the number of items at that moment. So that is the number that you can check against.
The question is, where / how / why did you determine to do something with item(22) specifically (22 being the key question here)?
In other words your code should look something like:
If 22 > WebBrowser2.Document.GetElementsByTagName("input").Count Then
'do something here
End If
Except that instead of 22 it really should be something like:
Dim i As Integer
'The value of i should become 22 due to some logic,
'but for the purpose of the conversation I am
'just going to assign it the value straight out.
i = 22
If i > WebBrowser2.Document.GetElementsByTagName("input").Count Then
'Item(i), in other words Item(22), does not exist
'Now that you know this, do what you want here.
End If
The test you ran earlier tells us that at that exact moment Item(20) was the maximum existing number. So you shouldn't be trying to write to Item(22).
My advice is free, and you may get what you paid for.
|
|
|
|
|
Thanks very much works great now.
Paul.
|
|
|
|
|
Hi
While using source code from
http://www.codeproject.com/kb/dotnet/ShareObjDotNet.aspx
dll Nepal.utilities.Miscellaneaous is missing
Please provide dll
Thanks
|
|
|
|
|
You need to ask the author of that article via by posting a message at the bottom of the page you linked to.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi,
I have to create a form in VB/VB.net that can write records on a mdb file on my website and also retrieve records from it.
I have never done any web programming, so I want to know how I can do it. Are there any sample codes available on the web? or can someone suggest me a book which explains such work.
Thanks and regards,
Neil Ranjan
|
|
|
|
|
Well look at this
http://www.google.co.za/search?hl=en&q=Introduction+to+ado.net+oledb&meta=&aq=f&oq=[^]
Did you look at this ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|