You have multiple issues here. First, you need to decide where you actually want to create the button, inside the main (game) window, or inside the tab window. Yes, when you create a tab control, it is actually its own window handle that gets drawn on top of the main window in which it is created (win_main, in this case.Hi i have a problem with tabs
When i create a control on a tab-field i cant click on it
I cant assign a control to a tab - the control ist just like freezed
for example:tab_main = API_Tab_Create(win_main,0,0,300,200) API_Tab_SetMinWidth(tab_main,100) API_Tab_InsertItem(tab_main,0,"TestTab1") API_Tab_InsertItem(tab_main,1,"TestTab2") API_Control_SetAutoTab(0) but_test0 = API_Button_Create(win_main,50,500,100,40,BS_CENTER) API_Control_SetText(but_test0,"Enable List")
can someone help me please?
/edit
Can someone tell me how to make a window non resizeable?
Now, the way you are currently creating the button control is in the main window. You CAN do this, although then there is the issue of which control is on top, the button or the tab control. Now, you'd think it would be the button because obviously you can see it, but the tab may not be redrawing itself over top of the button. This is why you can see it but can't click on it, because you're actually interacting with the tab control. You can correct this by creating the button BEFORE the tab control, as controls with the Max WinAPI DLL are layered from top to bottom, with newest controls below.
However, the better choice (and the only way to get API_Control_SetAutoTab() to actually work), would be to create the control in the window handle of the tab. Note, this is NOT just the handle of the tab control itself, but instead the result returned by API_Control_GetHandle(). So, in code...
tab_main = API_Tab_Create(win_main,0,0,300,200) tab_main_handle = API_Control_GetHandle(tab_main);//GET THE PARENT WINDOW HANDLE OF THE CONTROL. API_Tab_SetMinWidth(tab_main,100) API_Tab_InsertItem(tab_main,0,"TestTab1")//LEAVE THESE ALONE, AS THEY MODIFY THE ACTUAL CONTROL. API_Tab_InsertItem(tab_main,1,"TestTab2")//SAME ^. API_Control_SetAutoTab(0) but_test0 = API_Button_Create(tab_main_handle,50,500,100,40,BS_CENTER)//CHANGE THIS LINE'S CREATION HANDLE. API_Control_SetText(but_test0,"Enable List")Open the example .GM6 file with the DLL and you'll see what I mean, as this is how he defines his controls.
To create a window that is not resizeable, change the window style flags you use when creating it. For example, use API_Window_Create(0, 100, 100, 640, 480, WS_CAPTION, 0).
Edited by LaLaLa, 09 August 2011 - 04:51 AM.











