Link to home
Create AccountLog in
Avatar of systems_ax
systems_ax

asked on

windows forms in visual basic 2005

I have spent quite a bit on trying to resize my form on "maximize" event.  I have accomplished that via "dock" property in design time finally.  However, when I maximize my form, my "combo box" has something that looks like a gray splitter in the middle ( looks like a gray shaded vertical line) on it and unless I move my cursor over this splitter, the splitter will not dissaper.  
anyone has encountered this problem with a combo box upon maximizing?  Please suggest a solution.

I am using visual basic 2005.
ASKER CERTIFIED SOLUTION
Avatar of Smart_Man
Smart_Man
Flag of Egypt image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of systems_ax
systems_ax

ASKER

Smart_Man,
where in code do I do this?
thank you for replying.
Smart_Man,
never mind, it works but I do have 4 combo boxes on the form and when the window opens up in a center by default, I have the first combo box set to "selected", but when I maximize the form, all of the combo boxes get selected.  How do I change that?
thank you
if you would enritch our forums describes how it works, have you used what i have said or you have used another method.

now for manipulating the (selected) item. aka which item got the focus. you would probably use the (focus) property/setfocus/getfocus methods in combination with (tab order) property on the items properties.

tab order = which one get focus (selected) as you tab betweeen them.


hope that was helpful

waiting for your reply

i have used "me.refresh" on form_resize event and it does not have a splitter anymore.  But what I am having problems with is when my form maximizes, the font within the datagridview for example, stays the same.  I have this in regards to combo boxes:
under: frmtest_Resize, I have:

Me.Refresh()
        cmbClass.Refresh()
        cmbGrade.Select()

i do have 4 combo boxes, and all of them are still selected when form is maximized.
please any suggestions.
can I upload my form for you to take a look at?
sure of course.
i will be waiting for your for,

do you have a refresh for the combo box ?

have you tried visible = false then true for the combo box on the resize event of the form ?

have you tried combo box.redraw / refresh ?

me.repaint ....

waiting for your reply
Smart_Man,
I have uploaded my form.  this is what is happening:
1)all combo boxes are still selected after resizing even though only 1 of 3 is set to be set selected
2) the font within the combo boxes and datagridvies stays the same and does not enlarge
3)and the top 5 labels will not center and align to the gray box no matter what I try.
please any suggestions?

View all files for Question ID: 23215026
https://filedb.experts-exchange.com/incoming/ee-stuff/6937-WindowsApplication1.zip

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/6937-WindowsApplication1.zip 
it would be better if you sent screen captures.

have you tried the refresh , or even re-setting your objects upon the resize event ?

i do not have 2005 on my laptop now. it would be easier if you posted teh screens and some code here.

and please answer my questions. sorry i thought i still have the 2005 wheni told you to upload. besides admins here are more restrictive now on (doing the work for the author) . and i see that is a good thing. as long as we want to keep it as consultancy/experts place with useful comments. and not a remote work site.

waiting for your reply
2005 version does not have :

combo box.redraw
me.repaint ....

I have inserted me.refresh under each control's resize event and I still have all combo boxes selected upon resize of the form and the form flickers now after all the controls are set to .refresh under their individual events'.
hmmmmm.

i would suggest the following as a (work around):

* go from the start again.
* remove all modifications.
* under the form maximize
             - combobox1.visibale = false
             - combobox1.visiable = false
             - and so on for the rest ... .

i hope that will act like moving your mouse over the combobox.

i would suggest to move the mouse over the splitter in every combo box but wont go for such type of code unless i have too.

i just think we can try something easier if that did not work too. although , i think it should really solve the problem.

waiting for your reply
Smart_man,
thank you for replying.
I do not need the remaining 2 combo boxes to be invisible.  I simply need all of them (along with other controls) to stay on the form upon "resize" but I need the combo box1 to be selected only, and the otehr 2 to stay not-selected.

i suggested the hide/show procedure as a work around for the gray splitter. ( a manual refresh) instead of moving the mouse over the combobox. after that you can re-select the first combobox again. i hope i am not miles off.

waiting for your reply
Smart_Man,
you have provided me with an answer regarding the splitter.  me.refresh on main form_resize does work. i think i should reward you the points and open another question to be fair.  
please be looking for combo box on resize question from me very soon.
thank you for your help.